PDF Generator in the Webform

Hello team, I have an issue related to webforms and the pdf_generator module.

Specifically, when the user presses the submit button of the webform the form is saved normally in the content as it should but at the same time an error appears in the screen (“The website encountered an unexpected error. Please try again later.”).

The detailed error reports is mentioning: error: Class ‘Cpdf’ not found in Dompdf\Adapter\CPDF->__construct() (line 198 of /drupal/sites/ep-th-safety.web.cern.ch/modules/pdf_generator/lib/dompdf-dompdf/v0.8.3/src/Adapter/CPDF.php)

https://ep-th-safety.web.cern.ch/admin/reports/dblog/event/394438

there seems to exists recent activity on this issue

Don’t know why it worked before, maybe some version updates during the last Core upgrade happening last week changed this behavior.

On the issue seems they are dropping support of the dompdf library due library complexity on the dependencies.

1 Like

Thank you Eduardo! Do you have any suggestion to replace this module with another one?

Hi Apostoli,

Entity Print doesn’t support Ludwig anymore but there is a workaround.

Download the Entity Print module in your modules folder. Then create a lib folder within its folder and place there the dompdf library.

Then you need to edit the entity_print.module and add the following line at the top:

require_once(‘lib/dompdf-dompdf/v0.8.3/autoload.inc.php’);

This line tells the module from where to get the library from. The line above shows the structure of the lib folder and how you have to place the dompdf library.

1 Like

By the way there is a How To of what you want to achieve in the following post:

https://drupal-community.web.cern.ch/t/how-to-generate-a-pdf-after-submitting-a-webform