Hi all,
we are using the module Webform to offer some complex forms to the customers on a Drupal8 site.
We have to produce a PDF copy of each submission.
I've seen that there is not a Drupal8 version of Webform2PDF.
Which is, according to you, the best alternative?

Thank you very much

Claudio

Comments

sprite’s picture

Might the following D8 module help?

https://www.drupal.org/project/fillpdf

I have not used this module, but knew of it, so you may want to explore its viability for your application.

spritefully yours
Technical assistance provided to the Drupal community on my own time ...
Thank yous appreciated ...

ilclaudio’s picture

Thank you Sprite, but it seems that this module uses an external service: https://fillpdf.io/ that would be an unplanned additional cost.
Most of the CMS provides free tools to export contents in PDF.

PetarB’s picture

Hi Claudio

We did extensive work on this, and ran up against a number of problems.

In the end we redeveloped in 7.

We originally used a third-party service. There was an amazing online service that for a small monthly fee converted the page to a PDF. This required some javascript they provided to embed on the page in question. It was easy to implement and produced a perfect result. For some reason they closed up about a year ago, which we only found out when the customer told us it wasn't working anymore. So beware of a service like this, but it may be the only way to get a very 'accurate' result.

Using the MPDF/TCPDF and print PDF modules. Using a template this provided a reasonable outcome for us (https://www.drupal.org/project/print). Having said this, there was a lot of work to get it to look 'right'

ilclaudio’s picture

Yes Petar I prefer do not use external services but at the same time I can't use D7.
I'll try these two modules:
https://www.drupal.org/project/printable
https://www.drupal.org/project/entity_print

If these won't work then I'll try some external library not strictly related with Drupal.
It's strange that with D8 doesn't provide a way to export contents in the PDF format.

Thank you

cld

electrokate’s picture

@ilclaudio did you succeed at this?

PetarB’s picture

Yes, we ended up using wkhtmltopdf (via Drupal 7). I don't know about Drupal 8.

We uploaded the executable file for wkhtmltopdf to our server, ensuring it worked on our hosting environment, and pointed the print module to use it. I can't remember exactly where we go the executable file, it was a bit difficult to find, but it worked perfectly once we got it on the server.

The setup is a little more hassle than other PDF print plugins, however wkhtmltopdf is the only solution which will either reproduce exactly what you see in your browser, or work well with a print template page. It's the best solution.

cnngraphics’s picture

@petarB I installed wkhtmltopdf to my server, it runs great in command line and in a small php script. But within Drupal following the extension install, I cannot figure out how to provide the path to wkhtmltopdf.

Any help is appreciated! 

Thanks!

VM’s picture

via the print.module configuration and using a relative path to the library. The module should have an INSTALL.txt or README.txt that should provide direction.

PetarB’s picture

Edit: disregard my previously edited post.

We used Libraries and put the executable here:

"sites/all/libraries/wkhtmltopdf"

The other KEY issue was the permissions as I recall. You may need to set your permissions to be executable for the user.

fkelly12054@gmail.com’s picture

Try the PrintFriendly module.  https://www.drupal.org/project/printfriendly

There is a stable version for Drupal 8.  I run it on 8.6.1. 

mezitlab’s picture

The Webform module now includes a Webform Entity Print integration module, which handles downloading, exporting, and attaching generated PDF documents. Additionally, the Webform module allows the generated PDF document's header, footer, and CSS to be customized.
https://www.jrockowitz.com/blog/webform-entity-print-pdf

rpayanm’s picture

Thank you!

while(alive){learn();}