我使用的是Ubuntu10.10 amd64、SunJDK6.0.24和默认的ghostscript包。现在,我正在尝试让来自Ghost4J page的"Render a PDF document using SimpleRenderer" sample正常工作。
当“使用FontAnalyzer列出PDF文档的字体”示例工作时,SimpleRenderer-sample对于我到目前为止尝试过的所有PDF都会失败,并出现以下错误:
Caused by: net.sf.ghost4j.GhostscriptException: Cannot initialize Ghostscript interpreter. Error code is -20
at net.sf.ghost4j.Ghostscript.initialize(Ghostscript.java:318)
at net.sf.ghost4j.renderer.SimpleRenderer.run(SimpleRenderer.java:84)
... 3 more有什么建议吗?
发布于 2011-07-08 22:59:58
我在Ghostscript和Ghost4J版本的评论中问到(后者不是那么重要,因为我仍然可以从最新的标签0.4.3中收集到信息)。
我从here下载了Ghostscript代码,并从错误代码头文件中看到,-20意味着C代码中存在某种类型的错误。
定义如下:
#define e_typecheck (-20)如果可能,请尝试不同/更高版本的Ghostscript,或其他variant。或者,让我知道你在示例代码中使用了什么参数,并在某个地方托管任何示例PDF,这样我们就可以尝试一下。
https://stackoverflow.com/questions/5699958
复制相似问题