2010-08-16 31 views
3

Ghostscript不能正确渲染pdf中的嵌入字体。 例如http://vegro.nl/cmsfiles/ConsumentenAssortiment/Brochure/10.axd 右上角徽标('Thermrad')的字符都是锯齿状的。 如果我在Adobe Reader中打开文件,完全没有问题!Ghostscript在pdf中渲染嵌入字体效果不佳(全部锯齿)

你也有这个问题吗?有没有解决方法? 我一直在寻找天,但我找不到任何东西..

我尝试了Windows Vista和CentOS上的Ghostscript 8.64和8.71。

非常感谢! Dave

+0

哪个是您用于Ghostscript的命令行?而这个.axd文件到底是什么? - 顺便说一句,对我来说thingie无法在Reader 9.3.3中打开 - 它说*“文件无法通过网络加载......也许会损坏?”* – 2010-08-16 19:58:11

+0

另外,您想用Ghostscript实现什么功能。你有一个PDF - 那么你想要ghostscript将其转换为?!? – 2010-08-16 20:10:50

回答

3

我的建议是使用Ghostscript 8.71。然后使用这个命令行:

gswin32c.exe^
     -sDEVICE=pdfwrite^
     -o thermrad-out.pdf^
     -dPDFSETTINGS=/printer^
     10.axd 

这应该做的PDF转换成一个没有问题了。因为原始.axd文件在嵌入字体时确实存在问题。 (我使用XPDF套件中的pdffonts.exe进行检查)。之后我让Ghostscript的修理它,问题是在修复PDF走了3页

[....] 
     ............ Page 3 ............................... 
    name         type    emb sub uni object ID 
    ------------------------------------ ----------------- --- --- --- --------- 
    YCRHYF+HelveticaNeue-LightExt  Type 1C   yes yes yes 249 0 
    XCZBKH+HelveticaNeue-Light   Type 1C   yes yes yes 250 0 
    Error: Illegal entry in bfchar block in ToUnicode CMap 
    YCRHYF+HelveticaNeue-LightExt  Type 1C   yes yes yes  15 0 
    Error: Illegal entry in bfchar block in ToUnicode CMap 
    YCRHYF+HelveticaNeue-LightExt  Type 1C   yes yes yes  19 0 
    Error: Illegal entry in bfchar block in ToUnicode CMap 
    YCRHYF+HelveticaNeue-LightExt  Type 1C   yes yes yes  41 0 
    Error: Illegal entry in bfchar block in ToUnicode CMap 
    YCRHYF+HelveticaNeue-LightExt  Type 1C   yes yes yes  45 0 
    Error: Illegal entry in bfchar block in ToUnicode CMap 
    YCRHYF+HelveticaNeue-LightExt  Type 1C   yes yes yes  49 0 
    Error: Illegal entry in bfchar block in ToUnicode CMap 
    YCRHYF+HelveticaNeue-LightExt  Type 1C   yes yes yes  53 0 
    Error: Illegal entry in bfchar block in ToUnicode CMap 
    YCRHYF+HelveticaNeue-LightExt  Type 1C   yes yes yes  57 0 
    Error: Illegal entry in bfchar block in ToUnicode CMap 
    YCRHYF+HelveticaNeue-LightExt  Type 1C   yes yes yes  61 0 
    [....] 

:你10.axd第3页出现该问题:

for /l %i in (1,1,16) do (
     echo. ............ Page %i ...............................^
     & pdffonts.exe -f %i -l %i 10.axd^
     & echo.) 

输出这个

c:\> pdffonts.exe -f 3 -l 3 thermrad.pdf 

    name         type    emb sub uni object ID 
    ------------------------------------ ----------------- --- --- --- --------- 
    CZBBTM+HelveticaNeue-LightExt  Type 1C   yes yes no  13 0 
    MXETZY+HelveticaNeue-Light   Type 1C   yes yes no  40 0 
+0

更新我的DLL到9.16解决了我的问题,颜色和字体!谢谢! – AndyClaw 2015-08-03 17:52:01

0

在将PDF转换为JPG格式时,为我们平滑字体渲染的治疗方法是使用-dGraphicsAlphaBits=4 -dTextAlphaBits=4打开文本抗锯齿功能。

这里是一个windows批处理文件,我用它来转换为在命令行上传递的page size。样本调用:pdf2jpg infile.pdf 11x17

gswin64c.exe^
-dNOPAUSE -P- -dSAFER -dBATCH^
-dGraphicsAlphaBits=4^
-dTextAlphaBits=4^
-sDEVICE=jpeg^
-dJPEGQ=85^
-r300x300^
-sPAGESIZE=%2^ 
-sOutputFile=%~n1.jpg^
%1 

还存在与字体抗锯齿至少一个known issue被在一些GS版本自动关闭,如果透明图像都存在。 Convert a PDF to a Transparent PNG with GhostScript有一个解决方案。

相关问题