2011-01-13 93 views
6

因此,我想使用Ghostscript將以PCL格式創建的文件轉換爲PostScript。使用Ghostscript將PCL轉換爲PostScript

這是我的問題的要點。我只是試圖在命令行上運行它,但在最後階段它將不得不運行在像命令 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 

回答

7

您正在使用的Ghostscriptgs),無法讀入和interprete PCL。該可執行文件名爲pspcl6

您應該GhostPDL是interpretes PCL組件使用。

然後,像

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

命令應該將PCL轉換爲PDF。對於PostScript Level 2,使用-sDEVICE=ps2write

但是,它可能是很難找到的pspcl6預編譯的二進制文件。儘管它是Ghostscript系列產品的一部分,但它並不爲人所知。您可能需要編譯+編譯您自己的版本from the sources

更新:

相關問題