• Resolved dllive

    (@dllive)


    Hi all

    Ive currently appended the date the entry was made to the filename using a mergetag. It looks like:

    My pdf – {entry:date_created}

    This causes the filename to be “My pdf – 2019-10-06 07_56_08.pdf” which is great, but can I remove the timestamp? I just need the date.

    Also, in my functions.php file, I have a function which – when the form is submitted – generates an ID for the user based on what they have entered. Is it possible to pass this variable to gravity pdf so that its appended to the filename?

    Thanks

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Jake Jackson

    (@blue-liquid-designs)

    You’ll likely want to utilise the gfpdf_pdf_filename filter to dynamically control the name of your PDF: https://gravitypdf.com/documentation/v5/gfpdf_pdf_filename/

    Alternatively, you could save the current date and your User ID in hidden fields in your Gravity Form and then reference them in merge tags.

    • This reply was modified 6 years, 4 months ago by Jake Jackson. Reason: Typo
    Thread Starter dllive

    (@dllive)

    Thanks so much Jake. Ive got that working now using the the gfpdf_pdf_filename filter .

    Thread Starter dllive

    (@dllive)

    Hmm. how do I get the name that Ive called the pdf within Gravity PDF?

    In the documentation it reads:
    $name | string
    The current PDF filename

    Ive tried

    return "$name_{$entry[1]}_{$year_month_date}";

    But thats not working.
    Thanks

    Thread Starter dllive

    (@dllive)

    Ah! Ive just figured it out. (its early, havnt had my coffee yet!)

    Plugin Author Jake Jackson

    (@blue-liquid-designs)

    Glad to hear it! Happy PDFing.

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Dynamically set the pdf filename’ is closed to new replies.