How to generate multilingual content Pdf in PHP

穿精又带淫゛_ 提交于 2019-11-28 12:33:07
devOp

Yes, there's a way. I just had the same issue. Why Adobe Reader is asking for the language pack i don't know.

But i know that the best way to create multilingual PDFs is to use the Arial Unicode MS-Font which is included in windows. That's the font with the most characters according to wikipedia!! But there's no Bold or Italics. You can buy a Arial Unicode Bold from http://www.linotype.com/en/817674/ArialUnicode-family.html#.

I use the Arial MS Unicode-Font with chinese, japanese, cyrilic. For western languages i use the normal Arial so i have italics and bold. An other possibility is to use for each language a own font which is made for this language.

To make the Arial MS Unicode to work with tcpdf follow the steps on the answer of this Question: Creating PDFs using TCPDF that supports all languages especially CJK

I hope i could help...

Use html2pdf for multilingual.
I tried with this and it worked for me.I developed site for (English/Japanese) Used font arialunicid0 for multilingual.

require_once('Classes/library/html2pdf.class.php');   
    //$html2pdf = new HTML2PDF('P', 'A4', 'en');
    $html2pdf = new HTML2PDF('P', 'A4', 'en', true, 'UTF-8');       
    $html2pdf->setDefaultFont('arialunicid0');       
    $html2pdf->pdf->SetDisplayMode('fullpage');
    $html2pdf->writeHTML($content, isset($_GET['vuehtml']));
    $filename = $filename .'_'.date('Ymd');
    $html2pdf->Output($filename.'.pdf','D');

It download file with Japanese text.
Only problem I facing here with file name.
IF I pass Japanese character for file name it downloads file with blank name.

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