使用Ghostscript将PCL转换为PostScript。

6
我想使用Ghostscript将PCL格式的文件转换为PostScript。这是我的问题要点。我只是试图在命令行上运行它,但在最后阶段,它将必须在类似“lp -d < gs something something”的lp命令上运行。
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
1个回答

10

您正在使用 Ghostscriptgs),该软件无法读取和解释PCL。

您应该从GhostPDL中使用解释PCL的组件:可执行文件称为pspcl6

然后,执行类似以下命令:

 pspcl6 ^
   -o out.pdf ^
   -sDEVICE=pdfwrite ^
    in.pcl

应该将您的PCL转换为PDF。对于PostScript Level 2,请使用-sDEVICE=ps2write

然而,尽管它是Ghostscript产品系列的一部分,但可能很难找到pspcl6的预编译二进制文件。您可能需要从源代码构建和编译自己的版本。

更新:


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接