ghostscript - 手动编码 Postscript 时,Ghostscript 会产生未定义的错误
问题描述
我已经有 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.
我知道我忘记了一些基本的东西——也许是与边界框相关的东西?
解决方案
推荐阅读
- angular - 如何在 SlickGrid 分组中添加自定义属性?
- vim - 如何创建 .vim/colors?
- reactjs - 如何禁用 React 中导入另一个组件的按钮?
- python - 使用 OpenCV 检测网格纸上线条较粗的最大矩形
- python - 为什么我的程序没有打印所有的可能性
- java - gradle java 应用程序的 Proguard 示例
- javascript - 如何将对象重组为特定格式的对象数组?
- sql - SQL Developer 中的表列长度为 100 但视图列长度为 150
- python - 永远不会实例化的类上的类方法的 Python 编码标准是什么?
- java - 为什么通过 stream() 调用比使用 if 子句更耗时?