Suitecrm and PDF

hello everyone, as per the subject, I have a problem with PDF generation in SuiteCRM 8.4.2, the blank page appears and no error in the suite log, but only in the apache one:

PHP Fatal error: require_once(): Failed opening required '/public/legacy/lib/PDF/LegacyMPDF/../../../modules/AOS_PDF_Templates/PDF_Lib/mpdf.php'

search for the file mpdf.php that it does not find because it does not exist, I know that suite8 no longer uses mpdf but tcpdf, but I wonder, since this is a non-customized module, how is it possible that there is this line in

\public\legacy\lib\PDF\LegacyMPDF

require_once __DIR__ . '/../../../modules/AOS_PDF_Templates/PDF_Lib/mpdf.php';

how can I solve the problem?
To get to 8.4.2 I followed the upgrade instructions from version 7.14, the installation went quite well, except for some small problems and this PDF.

Where is that line found, exactly?

at the beginning, line 49

What is set in the admin dashboard for pdf.

Is it happening with the particular modules?

public/legacy/lib/PDF

Other solution I saw on the forum is:

I have added a file php.ini with display_errors = off

@rsp it happens with the Quotes module

@pgr my problem concerns suitecrm 8 and does not refer to warning… it is right that it goes into error because the mpdf.php file does not exist in suitecrm 8, but I do not understand why a suitecrm file refers to a file that does not exist and goes into error with a blank page, I do not know how much modifying the display_error can solve

The place that is giving you this message is also telling you the file where the reference exists, and the line number.

I mean the place where the reference is located, not the place that is referenced (which is mpdf.php)

I don’t quite understand.
in
/public/legacy/lib/PDF/LegacyMPDF/LegacyMPDFEngine.php

there is a reference (line 49) to the file

/modules/AOS_PDF_Templates/PDF_Lib/mpdf.php’

which actually doesn’t exist in SuiteCRM 8 (it still exists in SuiteCRM 7.14)

@rsp in the link you posted there is no solution, but the problem is highlighted

Go to public/legacy/ and edit config.php file.

  'pdf' => 
  array (
    'defaultEngine' => 'TCPDFEngine',
  ),

I read the post better… I went to admin and pdf settings, in the drop-down menu there is only the TCPDF choice (already selected), I selected it again and saved.
Now the white page no longer appears and the PDF appears, but the display is completely distorted.
In config.php:

'pdf' =>
array (
'defaultEngine' => 'LegacyMPDFEngine',
),

which I will change as per your suggestion, but I doubt that it will change the distorted display

Try it and let us know. Mark post solution :white_check_mark: which solved your issue.

Run:

Admin → AdminTools → Repair → Quick Repair and Rebuild

I also changed the config.php, I did a Q&A, but the result is the same, the PDF appears, but it is distorted

Reset your file permissions and ownership correctly.


To overcome the symfony error you need to clear symfony cache by running next command on your SuiteCRM 8 instance root:

./bin/console cache:clear

  • Hard reload and refresh browser page

You may have to adapt the template contents to the new PDF engine. Maybe that’s what you mean by distorted? It’s rendering differently - but it should be fixable with some effort. I don’t know how to advise in this effort, sorry, I’ve never tried it

Are you able to fix it?