Knowledge base
1000 FAQs, 500 tutorials and instructional videos. Here, there are only solutions!
Troubleshooting a PDF error in PrestaShop 9.x
This guide helps you resolve an issue with the CMS Prestashop v9.x regarding the generation of PDF invoices from the administration panel (Back Office), particularly when the French language is used.
The problem
When attempting to view or download a PDF invoice for an order in French, PrestaShop (version 9.x) returns a 500 Error. This malfunction is related to an incompatibility between the PDF generation library (TCPDF) using the default font (helvetica) and the hosting configurations.
Define a compatible font
The solution is to force the use of the freesans font, which is more compatible, via a custom configuration file.
It is strongly recommended to create a defines_custom.inc.php file. This method is the safest because it ensures that the fix will not be lost during PrestaShop core updates.
To do this:
- Access your PrestaShop 9.x installation via FTP or the File Manager.
- Navigate to the
/config/directory. - Create a new file named
defines_custom.inc.php. Edit the
defines_custom.inc.phpfile and add the following content:<?php /** * Avoid error PDF, force font 'freesans'. */ define('PDF_FONT_NAME_MAIN', 'freesans');- Save the file and test the generation of an invoice in French.
Link to this FAQ: https://faq.infomaniak.com/2690
Has this FAQ been helpful?