Knowledge base

1000 FAQs, 500 tutorials and instructional videos. Here, there are only solutions!

Troubleshooting a PDF error in PrestaShop 9.x

Update 08/31/2026

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:

  1. Access your PrestaShop 9.x installation via FTP or the File Manager.
  2. Navigate to the /config/ directory.
  3. Create a new file named defines_custom.inc.php.
  4. Edit the defines_custom.inc.php file and add the following content:

    <?php
    /**
     * Avoid error PDF, force font 'freesans'.
     */
    define('PDF_FONT_NAME_MAIN', 'freesans');
  5. Save the file and test the generation of an invoice in French.

Has this FAQ been helpful?