2010-08-16 99 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有一個解決方案。