gpt4 book ai didi

ghostscript - 手动编码 Postscript 时,Ghostscript 会产生未定义的错误

转载 作者:行者123 更新时间:2023-12-04 14:08:29 25 4
gpt4 key购买 nike

我已经有大约 20 年没有手工编写 Postscript 代码了,所以我打开了 Bluebook 并将一些示例输入到名为 test.ps 的文件中。这是一个这样的例子:

%!PS
/doACircle
{ 0 0 54 0 360 arc stroke } def
/doAnEllipse
{ 1 .75 scale
doACircle
stroke } def
300 500 translate doACircle
4 {0 −72 translate
doAnEllipse} repeat
showpage

我在 Debian Linux 系统上使用 Ghostscript 和 Imagemagick。两者在其他方面都运作良好。当我运行这样的命令时:

convert test.ps test.png

我得到一个错误和一个转储:

Error: /undefined in �
Operand stack:
0
Execution stack:
%interp_exit .runexec2 --nostringval-- --nostringval-- --nostringval-- 2 %stopped_push --nostringval-- --nostringval-- --nostringval-- false 1 %stopped_push 1992 1 3 %oparray_pop 1991 1 3 %oparray_pop 1979 1 3 %oparray_pop 1833 1 3 %oparray_pop --nostringval-- %errorexec_pop .runexec2 --nostringval-- --nostringval-- --nostringval-- 2 %stopped_push --nostringval-- 3 --nostringval-- %repeat_continue --nostringval--
Dictionary stack:
--dict:727/1123(ro)(G)-- --dict:0/20(G)-- --dict:78/200(L)--
Current allocation mode is local
Current file position is 167
GPL Ghostscript 9.27: Unrecoverable error, exit code 1
Error: /undefined in �
Operand stack:
0
Execution stack:
%interp_exit .runexec2 --nostringval-- --nostringval-- --nostringval-- 2 %stopped_push --nostringval-- --nostringval-- --nostringval-- false 1 %stopped_push 1992 1 3 %oparray_pop 1991 1 3 %oparray_pop 1979 1 3 %oparray_pop 1833 1 3 %oparray_pop --nostringval-- %errorexec_pop .runexec2 --nostringval-- --nostringval-- --nostringval-- 2 %stopped_push --nostringval-- 3 --nostringval-- %repeat_continue --nostringval--
Dictionary stack:
--dict:727/1123(ro)(G)-- --dict:0/20(G)-- --dict:78/200(L)--
Current allocation mode is local
Current file position is 167
GPL Ghostscript 9.27: Unrecoverable error, exit code 1
convert-im6.q16: no images defined `test.png' @ error/convert.c/ConvertImageCommand/3258.

我知道我忘记了一些基本的东西 - 也许是与边界框相关的东西?

最佳答案

这是节目流中的一个奇怪角色。我的猜测是 您使用的是 Macintosh 并且它 出于某种原因您的键盘处理程序正在用一些表面上更合适的短划线字符替换连字符。这会创建一个格式错误的负数,它被解析为一个名称,然后……瞧……字典堆栈中没有定义这样的名称。

错误消息中可以帮助解决类似问题的一些线索是:

  • /undefined 错误是字典查找失败的结果。这可能发生在 loadknownget 或在程序流中自动查找可执行文件名称时。
  • 操作数堆栈转储显示单个 0,因此它必须发生在堆栈上只有一个 0 的地方。
  • ... 表明 GS 遇到了一个它不知道如何处理的字符。

关于ghostscript - 手动编码 Postscript 时,Ghostscript 会产生未定义的错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/66488602/

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