使用 Ghostscript 将 PCL 转换为 PostScript
所以我想使用 Ghostscript 将以 PCL 格式创建的文件转换为 PostScript。
这就是我的问题的要点。我只是想在命令行上运行它,但在最后阶段,它必须在 lp 命令上运行,例如 lp -d < gs 某事
GPL Ghostscript 9.00 (2010-09-14) 我将在 Solaris 10 服务器上运行它,但我相信任何 Unix 系统都应该类似地工作。
bash-3.00# /usr/local/bin/gs -sDEVICE=pswrite -dLanguageLevel=1 -dNOPAUSE -dBATCH -dSAFER -sOutputFile=output.ps cms-form.pcl
GPL Ghostscript 9.00 (2010-09-14)
Copyright (C) 2010 Artifex Software, Inc. All rights reserved.
This software comes with NO WARRANTY: see the file PUBLIC for details.
Error: /undefined in &k2G-210z100u0l6d0e63fa0V
Operand stack:
Execution stack:
%interp_exit .runexec2 --nostringval-- --nostringval-- --nostringval-- 2 %stopped_push --nostringval-- --nostringval-- --nostringval-- false 1 %stopped_push 1910 1 3 %oparray_pop 1909 1 3 %oparray_pop 1893 1 3 %oparray_pop 1787 1 3 %oparray_pop --nostringval-- %errorexec_pop .runexec2 --nostringval-- --nostringval-- --nostringval-- 2 %stopped_push --nostringval--
Dictionary stack:
--dict:1154/1684(ro)(G)-- --dict:0/20(G)-- --dict:77/200(L)--
Current allocation mode is local
Current file position is 30
GPL Ghostscript 9.00: Unrecoverable error, exit code 1
So I want to use Ghostscript to convert files that are created in PCL format to PostScript.
That's the gist of my problem. I am simply trying to run it on the command line, but in the final stage it will have to be run on a lp command like
lp -d < gs something something
GPL Ghostscript 9.00 (2010-09-14)
I will be running this on a Solaris 10 server but I believe any Unix system should work similar.
bash-3.00# /usr/local/bin/gs -sDEVICE=pswrite -dLanguageLevel=1 -dNOPAUSE -dBATCH -dSAFER -sOutputFile=output.ps cms-form.pcl
GPL Ghostscript 9.00 (2010-09-14)
Copyright (C) 2010 Artifex Software, Inc. All rights reserved.
This software comes with NO WARRANTY: see the file PUBLIC for details.
Error: /undefined in &k2G-210z100u0l6d0e63fa0V
Operand stack:
Execution stack:
%interp_exit .runexec2 --nostringval-- --nostringval-- --nostringval-- 2 %stopped_push --nostringval-- --nostringval-- --nostringval-- false 1 %stopped_push 1910 1 3 %oparray_pop 1909 1 3 %oparray_pop 1893 1 3 %oparray_pop 1787 1 3 %oparray_pop --nostringval-- %errorexec_pop .runexec2 --nostringval-- --nostringval-- --nostringval-- 2 %stopped_push --nostringval--
Dictionary stack:
--dict:1154/1684(ro)(G)-- --dict:0/20(G)-- --dict:77/200(L)--
Current allocation mode is local
Current file position is 30
GPL Ghostscript 9.00: Unrecoverable error, exit code 1
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您正在使用 Ghostscript (
gs
),它无法读入和解释 PCL。您应该使用GhostPDL中解释PCL的组件:可执行文件称为
pspcl6
。然后像这样的命令
应该将您的 PCL 转换为 PDF。对于 PostScript Level 2,请使用
-sDEVICE=ps2write
。但是,可能很难找到
pspcl6
的预编译二进制文件。尽管它是 Ghostscript 产品系列的一部分,但它并不为人所知。您可能需要从源代码构建+编译您自己的版本。更新:
You are using Ghostscript (
gs
), which cannot read-in and interprete PCL.You should use from GhostPDL the component that interpretes PCL: the executable is called
pspcl6
.Then a command like
should convert your PCL to PDF. For PostScript Level 2 use
-sDEVICE=ps2write
.However, it may be difficult to find pre-compiled binaries of
pspcl6
. It's not well known, despite it being part of the Ghostscript family of products. You may need to build + compile your own version from the sources.Update: