PDF and cyrillic fonts

Topics: Developer Forum, Project Management Forum, User Forum
Apr 15, 2009 at 7:12 AM
Edited Apr 15, 2009 at 7:22 AM
Hello! I have a trouble with generated PDF files with cyrillis words.

I generat $objPHPExcel with Russian words in cells. To let it be displayed in Excel properly, I convert words from native CP1251 (windows-1251) to UTF8:  mb_convert_encoding($text, 'UTF8', 'CP1251'). It works and displayed correctly both in Excel2007 and Excel5. Then I create PDF using PHPExcel_IOFactory::createWriter($objPHPExcel, 'PDF');.  PDF file creates successfully but! Russian words are displayed like multiple question marks ("?" symbols). I suppose that PDF is created without necessary fonts. I look through the created file and found:
/BaseFont /Helvetica-Bold
/Subtype /Type1
/Encoding /WinAnsiEncoding

As far as I know, WinAnsiEncoding has no russian letters in it. WinAnsi is 1252 - west europen charset, but I need 1251..

In   public function __construct($orientation='P', $unit='mm', $format='A4', $unicode=true, $encoding='UTF-8', $diskcache=false) {..     I changed $unicode to false and $encoding to cp1251 (windows-1251) thinking that necessary encoding will be set. But I was wrong. It makes almost no effect. Multiple question marks just replaced with symbols like.... like "N Ñ" in spanish (with tilde ~ above it), strikethrough "D Ð", bold dots between symbols and others..

Can you advice me something on how to generate PDF with russian words in it?

I can send created files on email if it needed. Just let me know.

Developer
Apr 16, 2009 at 8:59 AM
This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.
Developer
Apr 16, 2009 at 9:00 AM
This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.