gpt4 book ai didi

java - Ghostscript 初始化失败,简单的 Ghost4J 示例代码

转载 作者:行者123 更新时间:2023-11-30 09:49:38 32 4
gpt4 key购买 nike

我使用的是 Ubuntu 10.10 amd64、Sun JDK 6.0.24 和默认的 ghostscript 包。现在,我正在尝试获取 "Render a PDF document using SimpleRenderer" sample来自 Ghost4J 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 和 Ghost4J 版本(后者并不那么重要,因为我仍然可以从最新的标签 0.4.3 中了解到发生了什么)。

我从 here 下载了 Ghostscript 代码并从错误代 jetty 文件中看到 -20 意味着 C 代码中存在某种类型错误。

定义如下:

#define e_typecheck (-20)

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

关于java - Ghostscript 初始化失败,简单的 Ghost4J 示例代码,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5699958/

32 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com