TCPDF and RTL

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • rouhu
    Member
    • Sep 2020
    • 66

    #1

    TCPDF and RTL

    Good day,

    I have an issue with Arabic and RTL writing direction with PDF output. I noticed that I must use TCPDF to be able to display Arabic characters properly when the text is coming from user input and saved in entity form field (not hardcoded to template). Now the issue is then that RTL direction html tag <div dir="rtl" lang="ar"> does not work with TCPDF. Any ideas how this could be solved ?

    Thanks, Tim
  • rouhu
    Member
    • Sep 2020
    • 66

    #2
    I hacked it at: /custom/Espo/Modules/Tcpdf/Engine/EntityProcessor.php

    PHP Code:
            if ($pageFormat === 'Custom') {
                
    //$pageFormat = [
                //    $template->getPageWidth(),
                //    $template->getPageHeight(),
                //];
            
    $pdf->setRTL(true);
            
    $pageFormat 'A4';
            } 

    Comment

    • yuri
      EspoCRM product developer
      • Mar 2014
      • 9710

      #3
      Maybe it's also possible to achieve with an incline CSS.

      Comment

      Working...