How to create multilingual Pdf content in PHP

I use TCPDF to create multilingual PDF content in PHP. I use TCPDF and use the font "cid0jp", but it forces the user to download the language pack for Adobe Reader.

Is there a way to generate a multilingual pdf file without forcing the user to download any langauge package?

+4
source share
2 answers

Yes, there is a way. I had the same problem. Why is Adobe Reader requesting a language pack that I don’t know.

But I know that the best way to create multilingual PDF files is to use Arial Unicode MS Font, which is included in Windows. This is the font with most Wikipedia characters !! But no bold or italic. You can buy Arial Unicode Bold from http://www.linotype.com/en/817674/ArialUnicode-family.html# .

I use Arial MS Unicode-Font with Chinese, Japanese, Cyrillic. For Western languages, I use regular Arial, so I have italics and bold. Another possibility is to use for each language its own font created for that language.

To make Arial MS Unicode work with tcpdf, follow the instructions on this: Create PDF files using TCPDF that supports all languages, especially CJK

I hope I can help ...

+4
source

Use html2pdf for multilingualism.
I tried with this and it worked for me. I developed a site for (English / Japanese). The font arialunicid0 is used for multilingual languages.

 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 downloads a file with Japanese text.
Only the problem I am encountering here is with the file name.
IF I pass in a Japanese character for the file name, it loads the file with an empty name.

0
source

All Articles