【问题标题】:How to have French special character in a PDF?如何在 PDF 中添加法语特殊字符?
【发布时间】:2014-03-01 05:16:10
【问题描述】:

我在尝试为我的项目制作法语 PDF 时遇到了一些问题。它不显示像é , ò, ê.... 这样的特殊字符(它们的代码例如êó
所以,感谢this link 我试图包含我自己的字体,但它给出了这样的信息:

PDF error: This font cannot be embedded in the PDF document. If you would like to
use it anyway, you must pass Zend_Pdf_Font::EMBED_SUPPRESS_EMBED_EXCEPTION in the
$options parameter of the font constructor

你有什么解决办法吗?谢谢。

【问题讨论】:

    标签: pdf character-encoding internationalization zend-pdf


    【解决方案1】:

    您可以使用默认字体。每次绘制文本时只需使用编码 UTF-8

    $pdf = new Zend_Pdf();
    $page = new Zend_Pdf_Page(Zend_Pdf_Page::SIZE_A4);
    $page->drawText("Bonjour Hélène!", 705, 550,'UTF-8');
    

    【讨论】:

    • 我确认这是正确的答案。法语特殊字符必须使用正确的编码,无需添加字体。正确的编码 + 正确的字符代码(例如:ê)。投票赞成。
    猜你喜欢
    • 2012-09-13
    • 2013-08-29
    • 1970-01-01
    • 2017-10-25
    • 2022-11-02
    • 1970-01-01
    • 1970-01-01
    • 2020-07-01
    • 1970-01-01
    相关资源
    最近更新 更多