Prestashop 1.6.1 Arabic PDF Invoices Issue

In a right-to-left writing starts from the right of the page and continues to the left. Arabic script is the most widespread RTL writing system in modern times. As usage of the script spread, the repertiore of 28 characters used to write Arabic language was supplemented to accommodate the sounds of many other languages such as Persian, Pashto, etc.

I read in forum, that someone who are using prestashop in RTL language is having problem with PDF invoice text. He just upgraded to the new prestashop 1.6.1 and his PDF Arabic invoices text is appearing as question marks "??????????????". But, There is no change in /tools/tcpdf library in prestashop 1.6.1 version. So, perhaps your old prestashop installation had some patch or extra fonts in it. Please check it first and i'm hoping that will fix the question marks in your PDF invoices.

prestashop 1.6 arabic pdf invoices issue



If the above solution doesn't solved your question marks problem in your PDF invoices, and if the page interface is English, this issue happens but if you change the interface language to Arabic the issue disappears then you may want to try this solutions that i read on the forum.

As you may know that prestashop 1.6 uses DejaVu Sans font for both English and Arabic characters, and this font supports both character maps. But, in order fixes both ريال symbol AND Arabic text in your prestashop PDF invoices. Try change the font for both Arabic AND English to 'freeserif'. In classes\PDF\PDFGenerator.php. It will be like this:

    class PDFGeneratorCore extends TCPDF
    {
        const DEFAULT_FONT = 'freeserif';
    
        public $header;
        public $footer;
        public $content;
        public $font;
    
        public $font_by_lang = array(
            'ja' => 'cid0jp',
            'bg' => 'freeserif',
            'ru' => 'freeserif',
            'uk' => 'freeserif',
            'mk' => 'freeserif',
            'el' => 'freeserif',
            'vn' => 'dejavusans',
            'pl' => 'dejavusans',
            'ar' => 'freeserif',
            'fa' => 'dejavusans',
            'ur' => 'dejavusans',
            'az' => 'dejavusans',
            'ca' => 'dejavusans',
            'gl' => 'dejavusans',
            'hr' => 'dejavusans',
            'sr' => 'dejavusans',
            'si' => 'dejavusans',
            'cs' => 'dejavusans',
            'sk' => 'dejavusans',
            'ka' => 'dejavusans',
            'he' => 'dejavusans',
            'lo' => 'dejavusans',
            'lt' => 'dejavusans',
            'lv' => 'dejavusans',
            'tr' => 'dejavusans',
            'ko' => 'cid0kr',
            'zh' => 'cid0cs',
            'tw' => 'cid0cs',
            'th' => 'freeserif'
        );

Don't forget to backup your files first before you do this change. Clear cookies after your do the change and try to generate PDF invoices once more.