GhostScript错误 [英] GhostScript Error

查看:611
本文介绍了GhostScript错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在特定的PDF上,运行以下命令时:

On a particular PDF, when running the following command:

gs -dSAFER -dBATCH -dNOPAUSE -dQUIET -dFirstPage=1 -dLastPage=1 -sDEVICE=pdfwrite -sOutputFile=output.pdf input.pdf

我收到此错误:

GPL Ghostscript 8.71: Warning: 'loca' length 188 is greater than numGlyphs 93 in the font MGOXZX+Arial-BoldMT.

任何想法都表明此错误意味着什么以及如何解决该问题?

Any ideas what this error means and how to resolve the issue?

推荐答案

首先,Ghostscript并未将其声明为错误",而是警告".完全不同.

First, Ghostscript didn't declare this as an 'error', but a 'warning'. That's quite a difference.

第二,您要求Ghostscript输出PDF输入的第一页.奏效了吗?比较output.pdf和input.pdf第一页时,您是否看到任何明显的差异?

Second, you asked Ghostscript to output the first page of a PDF input. Did it work? Do you see any visible differences when comparing output.pdf and first page of input.pdf?

第三,如果确实有问题,则应指出您正在运行的Ghostscript版本. 最近的是8.71 .

Third, if there's really a problem, you should indicate which Ghostscript version you're running. The most recent one is 8.71.

更新:当然,StackOverflowNewbie已经通过引用警告消息来暗示Ghostscript的版本.

Update: Of course, StackOverflowNewbie had already hinted at the version of Ghostscript by quoting the warning message...

警告"的意思是:输出文件可能存在问题(其本身仍然是有效的PDF),但最好检查一下.

"Warning" means: there may be a problem with the output file (which in itself still is a valid PDF), but you better check it.

错误"的意思是:输出肯定存在问题,Ghostscript将中止所有进一步的处理;输出很可能甚至不是有效的PDF.

"Error" means: there surely is a problem with the output, and Ghostscript will abort all further processing; the output is very likely not even a valid PDF.

有很多不同的方法可以进一步调试问题.但是,如果您看不到有问题的文件,就不可能给出任何令人震惊的建议. StackOverflowNewbie报告输出页面看起来与输入页面有所不同.

There are a lot of different methods to further debug the problem. But it is impossible to give any nail hitting advice if you don't see the files in question. StackOverflowNewbie reports the output page to look different from the input.

这是要使用的大锤:将-dDEBUG添加到命令行:

So here's the sledgehammer to use: add -dDEBUG to the commandline:

gs \
  -sOutputFile=output.pdf \
  -dDEBUG \
  -dLastPage=1 \
  -sDEVICE=pdfwrite \
   input.pdf

注意事项!这可能会在您的控制台中产生大量的stderr/stdout输出.

Caveats! This will potentially produce an enormous amount of stderr/stdout output in your console.

如果您已经知道或有确切的线索可能会扎根确切的问题(您甚至可以通过查看输入和输出PDF之间的视觉差异来直接假设),则可以使用(而不是-dDEBUG)按以下顺序之一:

If you already know or have a certain clue where the exact problem may be rooted (which you could probably even directly assume from looking at the visual differences between input and output PDF), you could narrow it down by using (instead of -dDEBUG) one of the following, in order:

 -dPDFDEBUG      # (debug PDF Interpreter)
 -dPDFWRDEBUG    # (debug PDF Writer)
 -dTTFDEBUG      # (debug TTF Fonts)
 -dCCFONTDEBUG   # (debug compiled-in Fonts)
 -dFAPIDEBUG     # (debug Font API)
 -dCFFDEBUG      # (debug CFF Fonts)
 -dCMAPDEBUG     # (debug CMAP)
 -dDOCIEDEBUG    # (debug CIE color)
 -dSETPDDEBUG    # (debug setpagedevice)
 -dSTRESDEBUG    # (debug Static Resources)
 -dVGIFDEBUG     # (debug ViewGIF)
 -dVJPGDEBUG     # (debug ViewJPEG)
 -dINITDEBUG     # (debug Initialization)
 -dEPSDEBUG      # (debug EPS handling)
 -dPDFOPTDEBUG   # (debug PDF Optimizer/Linearizer)

此外,由于警告中提到了字体Arial-BoldMT,因此您应该首先检查 两者 的字体嵌入状态,并在的帮助下输入和输出页面pdfinfopdffonts:

Also, since the warning mentions font Arial-BoldMT, you should first check the status of font embedded-ness of both, input and output pages with the help of pdfinfo and pdffonts:

 pdfinfo -f 1 -l 1 -box input.pdf
 pdfinfo -box output.pdf
 pdffonts -f 1 -l 1 input.pdf
 pdffonts output.pdf

Update2:

您可以尝试从原始PDF中提取字体,以进行进一步研究. (如果您不知道如何执行此操作,请询问新的单独的SO问题,例如如何从PDF中提取字体以进行进一步分析?" 如何进行调查出现内部故障的字体?" )

You could try to extract the font(s) from the original PDF for further investigation. (If you don't know how to do this, ask new, separate SO questions such as "How can I extract fonts from a PDF for further analysis?" and "How can I investigate a font for internal faults?")

这篇关于GhostScript错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆