I've got a "little" problem with Zend Framework Zend_Pdf class. Multibyte characters are stripped from generated pdf files. E.g. when I write aąbcčdeę it becomes abcd with lithuanian letters stripped.
I'm not sure if it's particularly Zend_Pdf problem or php in general.
Source text is encoded in utf-8, as well as the php source file which does the job.
Thank you in advance for your help ;)
P.S. I run Zend Framework v. 1.6 and I use FONT_TIMES_BOLD font. FONT_TIMES_ROMAN does work
I believe Zend_Pdf got UTF-8 support in 1.5 - What version of Zend Framework are you running?
Also - what font are you trying to render with? Have you tried alternate fonts?
Have you made sure that you are setting the character encoding as this example from the manual?
If you're stuck into having to use a bold font, maybe try one of the other bold fonts?
ZF v. 1.6, TIMES_BOLD (as I understand thats the only way to make text bold?)
Zend_Pdf
supports UTF-8 in version 1.5 of Zend Framework. However, the standard PDF fonts support only the Latin1 character set. This means you can't useZend_Pdf_Font::FONT_TIMES_BOLD
or any other "built-in" font. To use special characters you must load another TTF font that includes characters from other character sets.I use Mac OS X, so I tried the following code and it produces a PDF document with the correct characters.
See also this bug log: http://framework.zend.com/issues/browse/ZF-3649