Generate PDF Form Action Overview
The Generate PDF Form Action from JetFormBuilder enables users to create custom PDFs dynamically based on the information submitted through a form. This form-to-PDF generator is especially useful for creating a variety of documents, such as invoices, survey reports, receipts, contracts, and certificates.
Contents
- Generate PDF Form Action Installation
- Creating the Form
- Generate PDF Form Action Settings
- Template Editor
- Form Preview
Use cases for the PDF form generator include:
- personalized reports for clients;
- automating invoice generation for eCommerce transactions;
- generating certificates for course completions;
- replicating submission data into standardized documents.
These capabilities improve workflow efficiency in both business and educational environments.
To be able to use Generate PDF Form Action, one needs to have:
- JetFormBuilder plugin installed and activated;
- Generate PDF Form Action installed and activated;
- web form created with the JetFormBuilder plugin;
- a PDF template created with the Generate PDF Form Action editor.
Generate PDF Form Action Installation
To install the Generate PDF Form Action, one needs to go to WordPress Dashboard > JetFormBuilder > Addons, and in the All Available Addons section, find the PDF Attachment addon. Clicking on the “Install Addon” button will start the installation, and then clicking on the “Activate Addon” will activate it.
When activated, a new section, Templates, will appear under the JetFormBuilder menu item.
Create the Form
When the addon is activated, a form to apply it should be built.
The new form can be created following the path: WordPress Dashboard > JetFormBuilder > Add New.
For demonstration purposes, we create a “Zolden Customer Satisfaction” form.
The form includes the following fields:
- Text Field — a field that collects the name of the user;
- Text Field — a field that collects the email ID of the user;
- Radio Field — a field that collects the grade of user satisfaction on a scale from “1” to “5”;
- Radio Field — a field that collects the grade of probability if the user recommends the Zolden store on a scale from “1” to “5”.
We should add a PDF form generator action, “Generate PDF,” so this form can generate a PDF when the user clicks the “Submit” button.
To do so, one needs to go to JetForm > Post Submit Action to add a new action by clicking on the “+ New Action” button. By typing “PDF” in the search field and then clicking on the action, one can add the Generate PDF action to the form.
When added, the form action pop-up settings will appear.
Generate PDF Form Action Settings
The form action pop-up contains a set of settings that allow the PDF generation capabilities to be finetuned in a few steps:
- SELECT PDF TEMPLATE — a field where a PDF template can be chosen from available ones (upon default, this field is blank);
- “Add new template” — by clicking on this button, one can create a new PDF template in the blocks editor (if the template is already chosen, the button will say “Edit template”);
- FILE NAME — a field where one can generate the structure of the PDF filename (default value is “%_template_name%”). By clicking on the “wrench” icon, the file name structure can be defined by including dynamic tags like “%name%” or “%email%” that correspond to the list of available fields in the form. This allows each generated file to have a unique, descriptive name based on form data, making it easier to organize and locate files. The file name should be entered without an extension, as the system automatically appends .pdf to the file;
- “Attach to the Send Email action” — by clicking on this button, one can add the “Send Email” form action, ensuring that the PDF is delivered automatically to the recipient, admin, and also CC/BCC;
- SAVE GENERATED PDF — by enabling this toggle, one can save a copy of the generated PDF in the related form record and into the folder in “wp-content”;
- MESSAGES SETTINGS — this section includes a set of fields, ERROR CREATING FILE and ERROR CREATING ATTACHMENT, that allow one to modify the error values. The default values are: “Error when saving a pdf file, namely when creating it, or a directory for it” and “Error when saving a pdf file as attachment,” respectively;
To save or cancel changes, click the “Update” or “Cancel” button, respectively.
Template Editor
Alternatively, one can access the template editor by following the path: WordPress Dashboard > JetFormBuilder > Templates.
The template block editor provides tools to add text fields, images, and other form data. One can insert dynamic fields to populate the PDF with specific form submission data, such as name, date, or email ID. To do so, one needs to click on the “Insert JetFormBuilder Macros” button “[ / ]” and add the dynamic field.
The flow is as follows:
- one needs to add the same fields to the template as they are in the form;
- by clicking on the block with the field name, one can choose a corresponding field macro.
When all the fields are mapped with corresponding field macros, the changes can be saved by clicking on the “Save” button.
To stylize the PDF template, one can choose among the following blocks:
- Paragraph;
- Heading;
- Table;
- Image;
- Columns;
- Conditional Block;
- Custom HTML.
Once a template is customized, it can be saved for future use. This allows for the reuse of templates across different forms without the need to recreate the design each time.
Form Preview
Check the form submission process as it is perceived on the front end.
Form records can be accessed via the path: WordPress Dashboard > JetFormBuilder > Form Records.
The Generate PDF action was fired upon submission, and the generate_pdf_8033_filepath (in your case, the file name may be different) field contains the URL to the PDF.
Also, the PDF was sent to the user and website admin email IDs as specified in the “Sent Email” form action.
To access the PDF files in the WordPress file system, one needs to go to the folder wp-content/uploads/jet-form-builder inside the year/month subfolder where the saved PDF files should be located.
That’s all one needs to know about fine-tuning the “Generate PDF” form action in the JetFormBuilder plugin on a WordPress website.