Mpdf does not support Arabic and Chinese fonts

I am using mpdf. When I put the Arabic and Chinese words in WriteHtml (), the resulting pdf containing square fields instead of these fonts.

Please suggest!

Fonts example:

I am testing Ψ£Ω†Ψ§ Ψ§Ω„ΨΉΨ§Ω„Ω… ζˆ‘ηš„δΈ–η•Œ 
+6
source share
4 answers

On mPDF 6.0, we found that it made the Cantonese language for us:

 $mpdf->autoScriptToLang = true; $mpdf->autoLangToFont = true; 

It seems SetAutoFont is now deprecated.

+10
source

Add this to your PHP code:

 $mpdf->autoScriptToLang = true; $mpdf->autoLangToFont = true; 

in the css file make sure you have:

 font-family: dejavusanscondensed; direction: rtl; 

and make sure that all DejaVuSans * .ttf files are in the ttfonts folder

+8
source

You need to enable Asian PDF font support as follows:

 $pdf = $this->pdf->load(); $pdf->useAdobeCJK = true; $pdf->SetAutoFont(AUTOFONT_ALL); 
+3
source

Have you watched the latest version, version 6? It contains many updates for foreign languages.

0
source

All Articles