Create Custom PDFs from Form Entries in WordPress

By: Uttam N | Asked: 12/11/2023
ForumsCategory: General questionsCreate Custom PDFs from Form Entries in WordPress
Uttam N asked 4 months ago

Hi Team, As I was watching You tube video  Link : https://www.youtube.com/watch?v=_8Bz4TPFxYM and followed same steps from that. Steps followed:

  1. Design Sample form and created Sample View.
  2. In Form, Actions & Notifications added code. [frm-pdf view=40 entry="[id]" public=1] , 40 is ViewId.
  3. When I Open Form and fill information's and clicked on Submit.
  4. Download PDF' link Visible and when Clicked
  5. PDF downloading as a empty.

Any wrong steps I am doing or anything I missed, Please guide.

Rob LeVineRob LeVine replied 4 months ago

If you add that same frm-pdf shortcode to a page and hardcode the id as the same entry that as the issue, does the PDF show up?

Uttam N replied 4 months ago

<p>Hi Rob, Thanks for reply. When I enable 'Store entries submitted' PDF is getting created but of old entries attached screen shot of same.</p><p>1. I am looking to generate Forms fields to PDF without storing in Entries.</p><p>2. When I Disabled 'Form entries' and after submission Form, it was showing old content entries in downloaded PDF file.</p><p>3. Based on above point curious - Suppose multiple users simultaneously access the form(page) and generate PDF, How Formidable forms knows/handle which is correct file and it will download correctly on users system without mismatch?</p><p> </p><p>Thanks</p>

Rob LeVineRob LeVine replied 4 months ago

If you're not saving entries, the frm-pdf shortcode is never going to work because there is no [id] for it to work with. Each entry has its own unique ID so that's how Formidable will only send the output to the owner of the entry, assuming you set the notification up to send it to the email of the person submitting the form (i.e., there's a form on the field for the user's email and it's submitted with the rest of the data).

Uttam N replied 4 months ago

Thanks, I am having below queries related to above
1. If we don't save Entries then PDF generation is not possible. Is it dependent on stored entries Ids or on any UIDs.
2. If we save Entries and User won't provide/have Email ID, in that case on Form Submission, whether User will be able to download correct PDF, and how to avoid mismatch/old entries pdf downloading which is not associated to User.
3. Is there any TTL for old Entries (Old Entries should get deleted automatically), If not what is workaround.

Rob LeVineRob LeVine replied 4 months ago

First and foremost it would help if you explain, in detail, the use case and/or user experience you're trying to create. Without that information, I can only guess.
1. The frm-pdf shortcode works off the entry id. If you are not saving entries there is no way you can create a PDF from the data entered in the form.
2. If they won't/can't supply a unique identifier and are not logged in, I don't see how you could match them up with their entry later on. The only solution I can think of is to email them a link to a page that will generate the PDF and the link you send them includes the ID of the entry. Yes, if someone else got a hold of that link they'd be able to see the PDF as well.
3. Old entries are not automatically deleted. You could either make it part of your process (again, having no idea what you're trying to accomplish makes it difficult to suggest something) or you can create a standalone PHP program that deletes entries that are "older than X" and create a CRON job to run it daily

Uttam N replied 4 months ago

<p>From Docs I was reading to show Uploaded Image in View with code <img src="[art-file size=medium]"/> and replace art-file with field Id, But when I submit Form 1. In Entries after storing, Image name get changed from "apple.png" to "apple-1.png". 2. After downloading pdf its showing different Image url having name "apple-1-300X225.png" Also attached screenshot for the same. Anything wrong I am doing/missed any entries settings.</p>

Rob LeVineRob LeVine replied 4 months ago

This is a completely different topic now. I'm not sure why you care what the file is named. Yes the file name can sometimes get appended with -# and that's so that the file names on the server are unique. Maybe it happens when you can upload multiple files? I'm not really sure, but again, I'm not sure why you care. As for "different image URL" I'm not sure what that even means. There's also no screenshot attached. I suggest starting a new question in the forum.

Uttam N replied 4 months ago

<p>Hi, When download PDF , I am not able to see Image attached in the PDF file, instead I could see path of Image as shown in attached screen shot.</p>

Uttam N replied 4 months ago

Thanks for your support, I was able to load/bind Image in Forms View

Making the Best WordPress Plugin even better - Together

Take on bigger projects with confidence knowing you have access to an entire community of Formidable Experts and Professionals who have your back when the going gets tough. You got this!
Join the community
crossarrow-right