PDF Action for Elementor PRO Form
This Action is available only for the Form included in paid version of Elementor (Elementor PRO), that is NOT included in our plugin.
Enabling this Elementor PRO Form Extension
you can find another new " Actions After Submit" called PDF.
Add it to "Add Action" multi-select and the new PDF Section will appear.
Create the PDF
- Name of the PDF file, so what come before the .pdf suffix.
It's a good rule give to it simple names, which don't contain special character or be too long, for File System limitations.
IMPORTANT: the result name must be unique, otherwise previous pdf will be overwritten, you can also use shortcodes and Token to dynamically generate it
- Folder is where the pdfs will be stored, by default is under elementor folder in wp-content/uploads, that is the root of every file uploaded as media.
- Template, choose an existent template from Elementor Template list. You can use dynamic data from form submission using the [form] Token.
Here an example with default form fields: [form:name], [form:email], [form:message]
Then there are some specific PDF page settings:
- Page Size, default is A4, but you can choose from all supported sizes (like A3, letter, etc)
- Page Orientation, choose for landscape or portrait render
- Page Margin, you can easily fill whole page setting margin to 0, or define your own frame size
Optionally you can also save the PDF as media for future queries:
- Save, activate it to save the rendered PDF as media which you can find in Media Library
- Title, the Media Title, you can also use shortcodes and Token to dynamically generate it
- Description, the Media Description, you can also use shortcodes and Token to dynamically generate it
Create the Template
With the support of Dynamic Tag Token you can fill the Template with all Dynamic data from the submitted Form.
- [form:name], render the Form Field with CustomID "name"
- [form:all-fields], render all Fields dynamically as a simple list Key: Value
So we inherited all his potentials but also his limits and weakness.
We report here some author considerations
- handles most CSS 2.1 and a few CSS3 properties, including @import, @media & @page rules
- supports most presentational HTML 4.0 attributes
- supports complex tables, including row & column spans, separate & collapsed border models, individual cell styling
- image support (gif, png (8, 24 and 32 bit with alpha channel), bmp & jpeg)
Limitations (Known Issues)
- not particularly tolerant to poorly-formed HTML input
- large files or large tables can take a while to render
- CSS float is not supported
Send PDF through Dynamic Email
- [form:pdf], put it everywhere in the email body to send the PDF file as attachement
- [form:pdf:url], render the complete url to the PDF file
- [form:pdf:url|basename], render the name of the PDF file
- [form:pdf:path], render the complete path to the PDF file on server
- [form:pdf:id], render the Media ID of saved PDF in Library
- [form:pdf:title], render the Media Title of saved PDF in Library
- [form:pdf:description], render the Media Description of saved PDF in Library
For example instead to send it as attachment, that will render the email quite heavy,
you can generate a simple Button with link to pdf:
NOTE: you must use Dynamic Tag Token with the example shortcode
or with Custom HTML:
<a href=" [form:pdf:url]">[form:pdf:title]</a>
List PDF generated files
If you need a simple list of files you can render it with FileBrowser Widget, targeting folder setting with the root Folder you decided in main PDF section.
If you save them in Media Library you can render an advanced list with Views Widget, which you let you also filter them based by a Media Meta value, like Author, Date, etc, and display them with a Custom preview.
If in PDF process generation you get this error (or similar):
PHP Parse error: syntax error, unexpected '?' in /public_html/wp-content/plugins/dynamic-content-for-elementor/vendor/symfony/dom-crawler/Crawler.php on line 1170
Is because on your server is running a non updated version of PHP (7.0).
Upgrade to PHP >= 7.1 version will resolve the bug of the required library used to create the PDF.