#Save Form Output to PDF file.

1 messages ยท Page 1 of 1 (latest)

jaunty dragon
#

I created a small plugin to allow users to save their content as a PDF file. It's not perfect by any stretch but it works.

Create a new folder in your plugin directory called "div-to-pdf"

Next you will need to install mpdf into the new folder using composer.

composer require mpdf/mpdf

Upload the following PHP and JS files to the folder (edit the highlighted lines for your server)

#

Usage of shortcode: Simply include the following shortcode somewhere in the form using a custom HTML block. Replace mwai-ABC123 with your output field ID.

[div_to_pdf_button div_id="mwai-ABC123"]

#

You can include an argument of orientation="landscape" to change the orientation of the exported PDF (default is portrait)

wide geyser
#

Amazing, thank you so much for this. Can I ask, does this render the CSS styling?

#

Man installing composer looks complicated ๐Ÿ˜„

jaunty dragon
#

It renders some CSS yes, as long as it is within the HTML as inline css ๐Ÿ™‚

jaunty dragon
jaunty dragon
wide geyser
sharp garden
#

@wide geyser the code work well?

marsh spade
#

Hi Jay, I swear I'd read you had a download to word version?! Are you still willing to share?

jaunty dragon
#

Use the following shortcode to add the button below the form/chatbot.

[div-to-doc-x div_id="mwai-OUTPUTID123"]

jaunty dragon
#

No worries. Let me know how you get on.

urban rock
#

Plugin could not be activated because it triggered a fatal error.
๐Ÿ˜ฆ