PDF template not downloading

When i try to generate the pdf template it gets downloaded and it says the pdf is damaged or corrupt

why is this happening ,

when i try to preview it says failed to load document

Which SuiteCRM version is this?

I would try:

  1. Open the downloaded PDF in notepad. Do you see garbled codes (this would be the expected thing in a PDF)? Or do you get text, or HTML? Any readable text errors? There might be clues there.

  2. Disable any filters/adblocks/anti-virus and see if it makes a difference

I have a bunch of errors that shows especially towards the mpdf.php file how to resolve this…

Post the errors, tell me the SuiteCRM version (always write this in your posts!)

<b>Notice</b>:  Undefined index: TABLE>>ID>> in <b>/var/www/suitecrm/modules/AOS_PDF_Templates/PDF_Lib/classes/cssmgr.php</b> on line <b>1166</b><br />
<br />
<b>Notice</b>:  A non well formed numeric value encountered in <b>/var/www/suitecrm/modules/AOS_PDF_Templates/PDF_Lib/mpdf.php</b> on line <b>37063</b><br />
<br />


br />
<b>Notice</b>:  A non well formed numeric value encountered in <b>/var/www/suitecrm/modules/AOS_PDF_Templates/PDF_Lib/mpdf.php</b> on line <b>37072</b><br />
<br />
<b>Warning</b>:  Illegal string offset 'ID' in <b>/var/www/suitecrm/modules/AOS_PDF_Templates/PDF_Lib/classes/cssmgr.php</b> on line <b>1248</b><br />
<br />
<b>Warning</b>:  Cannot assign an empty string to a string offset in <b>/var/www/suitecrm/modules/AOS_PDF_Templates/PDF_Lib/classes/cssmgr.php</b> on line <b>1248</b><br />
<br />
<b>Warning</b>:  Illegal string offset 'ID' in <b>/var/www/suitecrm/modules/AOS_PDF_Templates/PDF_Lib/classes/cssmgr.php</b> on line <b>1322</b><br />
<br />

these are the constant errors that are repeating

my suite version is Version 7.11.18

Sugar Version 6.5.25 (Build 344)

PHP 7.3

there is over 1500 error notices and messages

You need to get all of those errors out of there, to get a valid PDF.

  1. You could try fixing the original cause of the errors, but I don’t believe that is the best way. These are just “noise”, notices etc., they will inevitably be generated.
  2. It’s better to play with PHP settings to ensure they go away. Check out php.ini options such as display_errors and error_reporting (I don’t know which options are best, try several and remember to restart web server after any changes)
  3. It’s possible that the presence of these error messages inside the PDF is a SuiteCRM bug, and that it is already solved in a newer version. You should really make full backups and then upgrade your SuiteCRM… it’s very old, and it’s likely very insecure, you’re missing dozens of critical security fixes.

I still use 7.11.18 for some of my instances and the dowload option works in it that is is why i want to to use it as well