2011-01-13 3 views
6

Je souhaite donc utiliser Ghostscript pour convertir des fichiers créés au format PCL en PostScript.Utiliser Ghostscript pour convertir PCL en PostScript

Voilà l'essentiel de mon problème. J'essaie simplement de l'exécuter sur la ligne de commande, mais dans la phase finale il devra être exécuté sur une commande lp comme lp -d < gs quelque chose quelque chose

GPL Ghostscript 9.00 (2010-09-14) Je vais l'exécuter sur un serveur Solaris 10 mais je pense que tout système Unix devrait fonctionner de manière similaire.

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 

Répondre

7

Vous utilisez Ghostscript (gs), qui ne peut en lecture et interprete PCL.

Vous devez utiliser de GhostPDL le composant qui interprête PCL: l'exécutable est appelé pspcl6.

Ensuite, une commande comme

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

devrait convertir votre PCL au format PDF. Pour PostScript niveau 2, utilisez -sDEVICE=ps2write.

Cependant, il peut être difficile de trouver des binaires précompilés de pspcl6. Ce n'est pas très connu, bien qu'il fasse partie de la famille de produits Ghostscript. Vous devrez peut-être créer + compiler votre propre version from the sources.

Mise à jour:

Questions connexes