How to generate pdf files _with_ utf-8 multibyte characters using Zend Framework

后端 未结 4 1227
天命终不由人
天命终不由人 2020-12-16 06:30

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 wit

4条回答
  •  南笙
    南笙 (楼主)
    2020-12-16 07:09

    Have you made sure that you are setting the character encoding as this example from the manual?

    // Draw the string on the page
    $pdfPage->drawText($unicodeString, 72, 720, 'UTF-8');
    

    If you're stuck into having to use a bold font, maybe try one of the other bold fonts?

    Zend_Pdf_Font::FONT_COURIER_BOLD
    Zend_Pdf_Font::FONT_TIMES_BOLD
    Zend_Pdf_Font::FONT_HELVETICA_BOLD
    

提交回复
热议问题