Arabic script in PDF created by UFPDF

牧云@^-^@ 提交于 2019-12-18 09:11:36

问题


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


回答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.




回答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.



来源:https://stackoverflow.com/questions/2453728/arabic-script-in-pdf-created-by-ufpdf

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!