2016-11-23 107 views
0

如果字体无法找到,您如何告知ghostscript使用“fallback”字体?Ghostscript merge pdf字体错误:如何定义备用字体

当执行此命令的Ghostscript:

GS -q -dNOPAUSE -dBATCH -sDEVICE = pdfwrite -sOutputFile = /输出.pdf /input_pdf_with_missing_font.pdf

我收到此错误:

错误:/未定义在findresource操作数堆栈中:--dict:9/18(L) - C2_0 1 - 词典:6/6(L) - - 词典:6/6(L) - ArialUnicodeMS - dict:11/12(ro)(G) - --nostringval-- CIDFontObject --dict:8/8(L) - --dict:8/8(L) - Adob​​e-Identity执行堆栈:% interp_exit .runexec2 --nostringval-- - nostringval-- --nostringval-- 2%stopped_push --nostringval-- - nos tringval-- --nostringval--假1%stopped_push 1862 1 3%oparray_pop 1861 1 3%oparray_pop 1845 1 3%oparray_pop --nostringval-- --nostringval-- 2 1 3 --nostringval--%for_pos_int_continue --nostringval - - nostringval - - nostringval - - nostringval - %array_continue --nostringval - false 1%stopped_push --nostringval - %loop_continue --nostringval - --nostringval - --nostringval-- --nostringval-- - nostringval-- - nostringval--%array_continue --nostringval-- - nostringval-- - nostringval-- - nostringval-- - nostringval--%loop_continue字典栈:--dict :(1)(1)(1)(1)(1)(1)字典:106/127(ro)(G) - - 本案:286/300(ro)(G) - - 本案:22/25(L) - - 本案:4/6 - - 词典:26/40(L) - 当前分配模式为本地最后操作系统错误:2 GPL Ghostscript 8.70:不可恢复的错误,退出代码1

+0

我已经安装了版本8.70 –

+0

CentOS版本6.8 –

回答

0

您需要更新版本的Ghosts cript(如果你想说明使用的版本,它会帮助解决这些问题)。

您似乎正在使用现在已超过7年的版本8.70,当前版本为9.20。当前版本附带默认的CIDFont(您的PDF文件无法嵌入CIDFont,而不是字体)。

您必须检查随Ghostscript 8.70提供的文档以了解如何定义替代资源(请参阅Ghostscript安装文件夹,然后查看'doc'子文件夹),我不记得目前的方法是否适用于此类古代版本。然而上的CIDFont取代当前版本的文档也可以找到here

+0

用于yum/rpm的CentOS 6.8的Ghostscript版本是8.70 –

+0

是的,这就是您使用CentOS我猜旧应用程序的结果。我想我们应该从这个千年感恩。您可以自己下载并构建Ghostscript,或者向CentOS人员大吼一声以升级他们的软件包。或者尝试找出如何使用旧文档对旧版Ghostscript进行CIDFont替换,并且缺少替代CIDFont和相关支持文件。我个人会升级。 – KenS

0

我把@ KENS的意见,并安装Ghostscript的9.20(我想保持旧版本代替其他传统项目)

以下是具体步骤(I按照这些instructions):

找到GS的源包:https://github.com/ArtifexSoftware/ghostpdl-downloads/releases

在我的情况:https://github.com/ArtifexSoftware/ghostpdl-downloads/releases/download/gs920/ghostscript-9.20.tar.gz

个运行以下命令:

 

cd /tmp 

wget 
    https://github.com/ArtifexSoftware/ghostpdl-downloads/releases/download/gs920/ghostscript-9.20.tar.gz 

tar xzf ghostscript-9.20.tar.gz 

cd ghostscript-9.20 

./configure --prefix=/usr/bin/gs9 

make 

sudo make install 
 

并运行新版本:

 
/usr/bin/gs9/bin/gs -q -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile=/some/target/file.pdf /some/source/file.php 

并没有更多的字体问题!