PDF for Elementor Pro Form

This Action is available only for the Form included in the paid version of Elementor (Elementor PRO), that is NOT included in our plugin.

Enabling this Elementor PRO Form Extension you can find a new "Actions After Submit" called PDF.

Add it to "Add Action" multi-select and it will appear.

Create the PDF

  • Name of the PDF file, whatever stands before the .pdf suffix.
    Generally, for File System limitations, it is better to give simple names, that are not too long or contain special characters.
    IMPORTANT: the name must be unique, otherwise previous PDFs will be overwritten, you can also use shortcodes and Token to generate it.
  • Folder is where the PDFs will be stored, by default it is under elementor folder in wp-content/uploads, this is the root of every file uploaded as media.
  • Template, choose an existent template from the 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]
    IMPORTANT: PDF for its nature has several limitation, so limit advanced style and do NOT use javascript

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
If you save the submission as PDF all form fields will be stored as Media Meta data with his Custom ID as Meta Key.

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
IMPORTANT: the plugin use DOMPDF as PDF converter, actually the best performing HTML to PDF converter.
So we inherited all his potentials but also his limits and weakness.
We report here some author considerations

Features

  • 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

If you enabled also Dynamic Email as Form Action, then you can use the Form Token in the email body:
  • [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.


Warning

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.

Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.

Still need help? Contact Us Contact Us