Psliwa PHPPdf Bundle上的Charset

时间:2013-09-13 09:03:36

标签: php symfony pdf encoding fonts

关于Psliwa提出的关于Symfony2的PdfBundle,
当我尝试添加自定义字体时出现此错误:

  

注意:iconv():错误的字符集,在... / vendor / zendframework / zendpdf / library / ZendPdf / BinaryParser / AbstractBinaryParser.php第431行中不允许从'MacRoman'转换为'UTF-16BE'

在我的config.yml中,我有:

fonts_file: "%kernel.root_dir%/../src/Travel/PdfBundle/Resources/config/fonts.xml"

在我的模板中,我有:

<dynamic-page encoding="UTF-8" font-type="FFInfoFonts">

在我的控制器中:

public function pdfAction(Request $request, $ce, $year) {
    $format = $this->get('request')->get('_format');
    return $this->render(sprintf('TravelPdfBundle:PointsCard:pdf.%s.twig', $format));
}

在我的fonts.xml中,我有:

<font name="FFInfoFonts">
    <normal src="font/FF Info fonts/police Web/InfoDisplayComp.ttf" />
</font>

任何人都知道如何强制使用charset?

0 个答案:

没有答案
相关问题