开发者

Zend_Pdf font problems with german language.....?

开发者 https://www.devze.com 2023-02-14 16:24 出处:网络
I am using Zend_Pdf class to create a PDF document. Here the contents are in the GERMAN language, So when I write the content to the pdf it automatically converts those characters to some special cha

I am using Zend_Pdf class to create a PDF document.

Here the contents are in the GERMAN language, So when I write the content to the pdf it automatically converts those characters to some special chars.

I am not able to figure out the problem....?

I tried some code like

$str = html_entity_decode($str, ENT_COMPAT, "UTF-8");
开发者_StackOverflow中文版

But it is not taking it and showing the same result.....!!!!!!

Please provide some code or links that helps me........

Thanks in advance.....


Thanks Zsub,

I got the solution using following code :

$text = $this->_font->encodeString($text, 'UTF-8');


You probably write to a Zend_Pdf_Page using something like

$page->drawText($text, $xpos, $ypos);

Just add the encoding:

$page->drawText($text, $xpos, $ypos, 'UTF-8');
0

精彩评论

暂无评论...
验证码 换一张
取 消