2012-01-05 105 views
2

我正在使用tcpdf創建pdf,但它不能顯示中文字符,而只是顯示方框。我使用了它們提供的示例(tcpdf/examples/example_008.php),然後將cache/utf8test.txt更改爲中文字符,但顯示爲「方框」。我怎麼解決這個問題?tcpdf編碼中文字符

+0

使用Unicode支持字體。 – 2012-01-05 05:19:17

+0

https://alucard-blog.blogspot.in/2013/06/tcpdf-how-to-display-chinese-character.html 也可以試試這個。它爲我們工作得非常好 – 2018-02-09 07:48:43

回答

6

您需要使用unicode支持字體,如可以使用stsongstdlight字體爲中文。希望它可以幫助

+0

感謝您的回答 – Negolas 2012-01-05 06:37:04

5

試試這個

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

它只是幫助了我。希望它也能幫助你。

+0

嘿,這個工作,但只有中國/臺灣,但不是中國/中國。 – MonkeyMonkey 2014-10-10 14:43:46