Search code examples
zend-frameworktcpdf

Multiple language in tcpdf


Am stuck with a problem in tcpdf.Now am creating a pdf document using tcpdf.Here i have a field which is dynamical generated from pgsql database.It contain both arabic and english.But english words are reverted when they mix with arabic.Please help me with any tutorials or sample code links.


Solution

  • Please implement following solutions here:-

    1) put a copy of ARIALUNI.ttf in fonts folder under tcpdf installation (i've taken my copy from windows\fonts folder).

    2) make a temporary script in examples folder of tcpdf and execute it with this line:

    $fontname = $pdf->addTTFfont('../fonts/ARIALUNI.ttf', 'TrueTypeUnicode', '', 32);
    

    3) set the new font in your pdf generator script:

    $pdf->SetFont('arialuni', '', 20);
    

    Please refer also link How to generate multilingual content Pdf in PHP