If you generate the PDF's in a location that is accessible via http:// you could pass the path to the generated PDF to the page containing the form via the query string when you redirect to the page containing the form.
Ex. user clicks on "Share PDF" link, PDF is generated and use is redirected to http://mysite.com/myform?pdf=/path/to/pdf.pdf
Then you could configure a hidden field on your form, give it a field label of "PDF" or "Download PDF" and select the advanced tab and set it to be dynamically populated and then use the parameter name you use in the query string to pass the location of the PDF. In my example above the parameter would be "pdf" without the double quotes and save the form.
Ex. see this screenshot: http://dl.dropbox.com/u/185347/Slingshot/Pictures/Screen%20Shot%202011-12-06%20at%205.16.37%20PM.png
Now if you pass ?pdf=/path/to/file.pdf to the page containing the form that hidden field you added will be populated with whatever pdf= in the query string.
Now you have stored the value of the dynamically generated PDF as part of the form data and can display it in email notifications, the confirmation, etc. using that fields merge tag to output it's value.
Because that field only contains a string and doesn't know it should be formatted as a link, wherever you output the merge tag to display the link to the PDF you can simply go a step further and include all the markup to turn it into a link.
So instead of this (note these merge tags are examples, merge tags are unique to each form as the id's are dynamic):
{My hidden PDF field:5}
You could do this:
<a href="{My hidden PDF field:5}">Download PDF</a>
Or this:
<a href="{My hidden PDF field:5}">{My hidden PDF field:5}</a>
The first example would just output the value of the field which wouldn't be clickable as a link if it's displayed in HTML. The 2nd and 3rd examples would output it with markup to make it a link with the 2nd example using static link text and the 3rd example using the fields value again as the link text.
This is just a quick example. A tutorial on how to dynamically populate fields, including the query string method used in this example, can be found here:
http://www.gravityhelp.com/documentation/page/Using_Dynamic_Population
Posted 12 years ago on Tuesday December 6, 2011 |
Permalink