tcpdf encode chinese character

空扰寡人 提交于 2019-12-07 07:22:28

问题


I am using tcpdf to create a pdf, but it cant show chinese character, instead it just show square box. I used this example that provided by them and then changed the cache/utf8test.txt to chinese character but it show "square box". How am I solve this?


回答1:


You need to use unicode supporting font, like you can use stsongstdlight font for chinese. Hope it helps




回答2:


try this

$pdf->SetFont('kozminproregular', '', 12);

It just helped me. Hope it also helps u.




回答3:


I managed to get it to work with the Arial Unicode font.

$pdf->SetFont('arialuni', '', 12);

Only issue is it's $165 http://www.fonts.com/font/ascender/arial-unicode




回答4:


I found this copy all files to tcpdf/fonts and now I can just use it with $pdf->SetFont('DroidSansFallback', '', 8, '', false);



来源:https://stackoverflow.com/questions/8737772/tcpdf-encode-chinese-character

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