How to generate multilingual content Pdf in PHP

前端 未结 2 2100
忘了有多久
忘了有多久 2020-12-11 07:26

I am using TCPDF to generate multilingual content PDF in PHP. I am using TCPDF and using font \'cid0jp\' but It is forcing user to download language pack for adobe reader.

2条回答
  •  清歌不尽
    2020-12-11 07:56

    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.

提交回复
热议问题