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

465 views Asked by At

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");

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

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

Thanks in advance.....

2

There are 2 answers

0
Pushpendra On BEST ANSWER

Thanks Zsub,

I got the solution using following code :

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

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');