Display PDF in Browser
The generated PDF can easily and securely be displayed in a users browser once the form has been submitted using the Gravity Form redirect setting.
Before we discuss these methods just a note on security. To prevent unwanted users accessing sensitive data each PDF displayed using this method will check three things:
- If the user is logged in and their user ID matches the ID on the entry.
- Or, if the user’s IP address matches the IP address on file for the entry.
- Or, if an administrator is logged in with read privileges for Gravity Forms entries.
Passing Form Values
You’ll need to pass all of the following values to a URL you create in order to display the PDF in the browser:
lid parameters take information using Merge Tags,
gf_pdf won’t change and template will refer to the template file you would like to use when generating the PDF.
Text Confirmation Method
Page Confirmation Method
This option is more complex than the other two options as you need to install a third party plugin which allows you to use the URL parameters in the page you point to.
First download and install the URL Params plugin. Next, go to your form’s confirmation page and configure it to look like the screenshot below.
Finally, go to your WordPress page you linked to and, using the PDF Params plugin, you can construct the PDF link and access the form ID and entry ID parameters.
<a href="[urlparam param="lead_id"]">. The simple fix is to remove the quotes from the shortcode – this is valid:
<a href="[urlparam param=lead_id]">.
Redirect Confirmation Method
Automatically print when PDF is opened
To automatically force a print dialog box to be displayed when the PDF is viewed or downloaded from your website you can append
&print=1 to your PDF link.