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.
-
Have you tried my solution? – Roopendra Mar 05 '13 at 04:11
-
Thank you for your reply.I tried your solution.But it doesn't work for me. – Freddy Pv Mar 06 '13 at 09:12
2 Answers
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
For some time this font has not existed on a new Windows/Office. Details see: https://docs.microsoft.com/en-us/typography/font-list/arial-unicode-ms So you have to get it from another place ...
The new version of TCPDF has its own object to create font files, as they are used afterwards by TCPDF: TCPDF_FONTS
For more details and an example see: https://stackoverflow.com/a/70337995/2320007
- 754
- 10
- 25