我试图使用Amatic字体从谷歌在我的PDF文件,但它给我一个错误,如下所示。那是因为字体类型吗?我已经用Open进行了测试,而且它正在工作。
/var/www/vhosts/httpdocs/main/zend/library/Zend/Pdf/FileParser/Font/OpenType.php:555\nStack trace:\n#0 /var/www/vhosts/httpdocs/main/zend/library/Zend/Pdf/FileParser/Font/OpenType.php(121):Zend_Pdf_FileParser_Font_OpenType->_parseOs2Table()\n中的AH01071: Got错误: PHP致命错误:未识别异常'Zend_Pdf_Exception‘,消息“无法读取版本4表”#1 /var/www/vhosts/httpdocs/main/zend/library/Zend/Pdf/FileParser/Font/OpenType/TrueType.php(83):Zend_Pdf_FileParser_Font_OpenType->parse()\n#2 /var/www/vhosts/httpdocs/main/zend/library/Zend/Pdf/Font.php(701):Zend_Pdf_FileParser_Font_OpenType_TrueType->parse()\n#3 /var/www/vhosts/httpdocs/main/zend/library/Zend/Pdf/Zend_Pdf_Font::_extractTrueTypeFont(Object(Zend_Pdf_FileParserDataSource_File),:Font.php(615)(0) /var/www/vhosts/httpdocs/main/zend/invoice.php(27):Zend_Pdf_Font::fontWithPath('/var/www/vhosts...')\n#5 {main}\n除“Zend_Pdf_Exception‘wi.\n”外
我正在使用这个脚本来测试https://github.com/phpmasterdotcom/GeneratingInvoicesWithZendPdf/blob/master/public/invoice.php
发布于 2016-05-16 08:18:12
所发生的事情是: OpenType.php中的Zend代码显式地检查字体的OS/2表版本。是否高于3,则抛出异常。您的字体的OS/2表版本为4(据我所知,这是第五个版本,至少有6个版本)。
不幸的是,ZendPdf模块的最新版本(如在GitHub上)似乎仍然不支持version 4或更高版本。因此,除了寻找另一个pdf生成器-它确实支持版本4-我担心没有干净的解决方案。
您可以尝试编辑框架代码,但这当然有点可疑。作为另一种选择,显然它应该能够更改该版本并重新生成字体。参见这篇关于Tex论坛的文章 (在已接受的答案之后的帖子)。如果你选择了这条路,你可能会在论坛上找到更好的指导。
对不起,我不能提供更好的解决方案,但也许它能帮助你理解发生的事情。
https://stackoverflow.com/questions/37094822
复制相似问题