mpdf not supporting arabic and chinese fonts

后端 未结 5 1766
伪装坚强ぢ
伪装坚强ぢ 2020-12-31 16:57

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!

5条回答
  •  长发绾君心
    2020-12-31 17:26

    I guess this is pretty late but I've tried this for Arabic language using version 8.x and it worked for me.

    $mpdf = new Mpdf();
    $mpdf->autoLangToFont = true;
    $mpdf->WriteHTML($html);
    

    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

提交回复
热议问题