【问题标题】:Ghostscript initialization fails with simple Ghost4J sample codeGhostscript 初始化因简单的 Ghost4J 示例代码而失败
【发布时间】:2011-04-18 07:49:25
【问题描述】:

我使用的是 Ubuntu 10.10 amd64、Sun JDK 6.0.24 和默认的 ghostscript 包。 现在,我正在尝试让 "Render a PDF document using SimpleRenderer" sampleGhost4J page 工作。

虽然“使用 FontAnalyzer 列出 PDF 文档的字体”示例正在运行,但到目前为止我尝试的所有 PDF 的 SimpleRenderer-sample 都失败,并出现以下错误:

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

有什么建议吗?

【问题讨论】:

  • 这很可能来自底层的 Ghostscript 安装被破坏。它是否适用于命令行中的各种实用程序?
  • 我也遇到了这种情况。请帮忙!
  • 请在描述中添加 Ghostscript 和 Ghost4J 版本。

标签: java ubuntu ghostscript x86-64


【解决方案1】:

我在评论中询问了 Ghostscript 和 Ghost4J 版本(后者不那么重要,因为我仍然可以从最新的标签 0.4.3 中收集到发生了什么)。

我从here下载了Ghostscript代码,从错误代码头文件中看到-20表示C代码中存在某种类型错误。

这是定义:

#define e_typecheck (-20)

如果可能,请尝试不同/更高版本的 Ghostscript,或另一个 variant。或者,让我知道您对示例代码使用了哪些参数,并在某处托管任何示例 PDF,以便我们试用。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-03-31
    • 1970-01-01
    • 2016-08-12
    • 2015-08-28
    • 1970-01-01
    • 2014-05-28
    相关资源
    最近更新 更多