1

我将在 HP-UX 系统中使用 Ghostscript 转换 PDF 文件,以便我可以在 LX 和 LQ 打印机中打印这些文件。对于 LX 打印机——例如,我使用以下命令:

gs -q -dBATCH -dSAFER -r120x216 -dNOPAUSE -sDEVICE=eps9high -sPAPERSIZE=letter -sOutputFile=TEST.TEMP.pdf.LXPRINT TEST.pdf

每个 PDF 文件都可以正常工作。但每次我转换包含图像的 PDF 文件时,都会出现如下错误:

Error: /ioerror in --filter--
Operand stack:
   --dict:6/15(L)--   false   --dict:9/17(L)--   --nostringval--   --nostringval--
Execution stack:
   %interp_exit   .runexec2   --nostringval--   --nostringval--   --nostringval--   2   %stopped_push   --nostringval--   --nostringval--   --nostringval--   false   1   %stopped_push   1878   1   3   %oparray_pop   1877   1   3   %oparray_pop   1861   1   3   %oparray_pop   --nostringval--   --nostringval--   2   1   2   --nostringval--   %for_pos_int_continue   --nostringval--   --nostringval--   --nostringval--   --nostringval--   %array_continue   --nostringval--   false   1   %stopped_push   --nostringval--   %loop_continue   --nostringval--   3187   --nostringval--   --nostringval--   --nostringval--   --nostringval--   --nostringval--   --nostringval--   %array_continue   1749   6   13   %oparray_pop
Dictionary stack:
   --dict:1151/1684(ro)(G)--   --dict:1/20(G)--   --dict:75/200(L)--   --dict:75/200(L)--   --dict:108/127(ro)(G)--   --dict:288/300(ro)(G)--   --dict:22/25(L)--   --dict:6/8(L)--   --dict:21/40(L)--   --dict:1/1(ro)(G)--   --dict:1/1(ro)(G)--   --dict:1/1(ro)(G)--   --dict:7/15(L)--
Current allocation mode is local
Last OS error: 2
GNU Ghostscript 0.08.71: Unrecoverable error, exit code 1

如您所见,我使用的是 Ghostscript 8.71.1,我的系统是 HP-UX Itanium v​​11.23。

我已经安装了所有依赖项——jpeg、libXrender 和所有东西——但没有任何改变。

4

3 回答 3

0

就我而言,这是 tmp 文件夹和 imagemagic 在那里创建的文件的问题。imagic-{一些哈希字符}我添加了“-limit memory 512”来限制内存消耗并删除了临时文件。这解决了这个问题。

于 2015-03-12T20:53:20.237 回答
0

如果你仍然有问题。我遇到了完全相同的问题,最终将其追踪到一个非常小的 /tmp 挂载

测试

mount -o bind /path/to/space/ /tmp

导致上面的问题消失了,再玩了一下发现

export TMPDIR="/path/to/space/";

也工作

我正在使用 Debian Lenny 和 ImageMagick 6.3.7 我也考虑过

如何更改 imagemagick 的临时路径?

但它对我不起作用,我不想重新编译。

于 2014-10-09T12:13:09.700 回答
0

你从哪里得到二进制文件?也许打包程序没有启用图像渲染(或手动禁用它),也许他编译了一个静态链接的二进制文件?

您是否可以从源代码中自己编译它?

如果您自己编译,您可能需要编辑一些 makefile 以启用图像渲染。注意 makefile 中的 *.dev 关键字。有些 ar 默认被注释掉。

编辑: 您的 PDF 有什么特别之处吗?您是否交叉测试了不同操作系统平台(例如 Linux 或 Windows)上的 Ghostscript 8.71 是否可以处理您的 PDF?

于 2011-02-04T20:45:25.900 回答