Admin pdf download and save pdf with form

Formidable Forms
28 November, 2021 19:24:49
Polinet
Topics: 2
Messages: 6
Hi,

I have 2 questions please:

1. Is there a way to save the generated pdf directly with the form as a file attachment or a link to a pdf stored on the server? I want the generated and signed contract to be static and fixed instead of being generated from a template every time using the download shortcode. I know there is a save shortcode but is there a way to automatically save it to the form as a field upon submitting the form?

2. If the first point is not an opinion then is there a way for the admin to download a generated pdf when they are viewing the corresponding form entry? Or any other way to give admins access to the generated pdf short of building a front end display page for them as I intend to administer my portal entire from the admin back end and I can't figure out an option to download the pdf of the form from there.
29 November, 2021 00:35:11
E2Pdf
Support
Topics: 7
Messages: 3163
Hi,

Unfortunately currently it's not possible out from the box. We have both points in our roadmap but not yet ETA when it will be released, so currently it's possible to accomplish with custom hooks.

1. In case of 1st point It will be need to add some hooks which will edit entry after submission like:
- Fire [e2pdf-download id="1" dataset="123"] shortcode via PHP after submission
- Update entry value with generated URL.

2. Add custom PDF download URL to meta box while "View" / "Edit" entry, which is simpler and we have prepared "code" for it:

https://codeshare.io/qPQXZZ

- It must be added to your theme functions.php or as PHP Snippet.
- It must be replaced "27" to your Form ID.
- It must be replaced "299" to your E2Pdf Template ID.

We remain at your service.

We remain at your service.
We would really appreciate your feedback at WordPress.org!
20 December, 2021 00:44:11
Polinet
Topics: 2
Messages: 6
Hey,

I managed to build a pretty comprehensive portal for 2 party contract signing. Thank you very much for making such a wonderful plugin available and providing outstanding support.

Can I please ask for your help with the admin download pdf shortcode for TWO datasets? I am having trouble working it out on my own. My one dataset would be the entry->id but the other dataset id is stored in one of the fields inside the entry. How would I need to modify the shortcode you provided here https://codeshare.io/qPQXZZ to make it work for admin to be able to download the pdf?

Thank in advance.
20 December, 2021 06:54:33
E2Pdf
Support
Topics: 7
Messages: 3163
Hi,

Is it correct that your E2Pdf Template connected to "Merged Datasets"? If so, here is updated code: https://codeshare.io/K8Pwr7.

1460 must be replaced with your Field ID where stored 2nd dataset.

P.S. Code must work for any field if it outputs Entry ID or for Dynamic Field. It will not work for Lookup field as in this case Formidable Forms doesn't save relation and code must be modified to use DB to find out needed 2nd Entry ID by stored Lookup value.

P.P.S. If you need to generate 2nd PDF download link instead of "Merged Datasets", let us know please. The logic actually will be pretty the same and it will require just a bit modification to code.
We would really appreciate your feedback at WordPress.org!
20 December, 2021 17:37:03
Polinet
Topics: 2
Messages: 6
Hey, thank you once again for your most excellent support! This is exactly what I needed and works as expected.