I am using mpdf. When I supplied the arabic and chinese words to the WriteHtml(), the resulting pdf containing square boxes instead of those fonts.
Please suggest!
Sample fonts:
I am testing أنا العالم 我的世界
I am using mpdf. When I supplied the arabic and chinese words to the WriteHtml(), the resulting pdf containing square boxes instead of those fonts.
Please suggest!
Sample fonts:
I am testing أنا العالم 我的世界
You need to enable the support of PDF Asian font like this:
Add this to your php code:
in css file make sure that you have:
and finly make sure that all DejaVuSans*.ttf files are in ttfonts folder
I guess this is pretty late but I've tried this for Arabic language using version 8.x and it worked for me.
I needed to add
$mpdf->autoLangToFont = true;
because some fonts don't render arabic and that's where it gets messy with squares, etc.for more information here
On mPDF 6.0, we found this made Cantonese work for us:
Seems SetAutoFont is now deprecated.
Have you looked at the latest release, version 6? It contains a lot of upgrades for foreign languages.