[Solved] Arabic script in PDF created by UFPDF

I have issues with Arabic script inside a PDF document created by UFPDF, that is an extension of FPDF that supports unicode fonts. I have correctly converted Arial font to the format waited by UFPDF, and I have no issue with Unicode special characters in other languages (e.

g. French, Spanish, German, etc.)

The single characters of Arabic script are not shown from right to left, but from left to right and it splits as single chars.

E.g.: ????? (school) is shown like ? ? ? ? ?

How to handle?

Thanks in advance

Solution #1:

Use TCPDF http://www.tcpdf.org/ instead. It can handle UTF-8 Unicode and Right-To-Left languages.

I think if I am not wrong it’s based on FPDF. So any code you already have for FPDF might work with TCPDF.

Respondent: satrun77
Solution #2:

May be you need to check http://www.ar-php.org/Glyphs-example-php-arabic.html

Ar-PHP library gives the ability to use UFPDF, and fixes the separate characters using Glyphs classes (part of the library).

You need to download the library to check the pdf example, as it is not listed in the website.

Respondent: wesamly
The answers/resolutions are collected from stackoverflow, are licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0 .

Leave a Reply

Your email address will not be published.