Operating System - HP-UX
1819929 Members
3077 Online
109607 Solutions
New Discussion юеВ

convert pdf to pcl w/ghostscript...

 
Manuel Contreras
Regular Advisor

convert pdf to pcl w/ghostscript...

The developers are creating pdf output, which they would like to print.
Initially acroread from adobe, looked like the solution:
convert pdf to postscript and print....but I found that some of our older laserjet printers (laserjet4) had issues when they received any postscript print request.

Now I am looking at ghostscript to go from pdf to pcl which all printers can support.

I am using the following command to convert the file from pdf to pcl:

/usr/local/bin/gs -sDEVICE=laserjet -sOutputFile=laserjet.prn -dNOPAUSE -q -dBATCH b.1558648.00.out.pdf -c quit



$ file b.1558648.00.out.pdf
b.1558648.00.out.pdf: lex command text

$ file laserjet.prn
laserjet.prn: PCL

Since I am new to ghostscript, are there any arguments I can take advantage of?
maybe cleanup the syntax listed above?

thanks for your assistance,
manuel
3 REPLIES 3
Manuel Contreras
Regular Advisor

Re: convert pdf to pcl w/ghostscript...

I am particularly looking for a way to incorporate the actual printing of the new PCL file.

a ONEliner would be great...

thanks,
manuel
Manuel Contreras
Regular Advisor

Re: convert pdf to pcl w/ghostscript...

ok, I found my one liner...I think:

cat b.1558648.00.out.pdf | /usr/local/bin/gs -sDEVICE=laserjet -q -dNOPAUSE -dPDFFitPage -dBATCH -sOutputFile=- - 2> /dev/null | lp -d printerID

the only problem is that the output tends to be high and to the right...

I have tried several ghostscript options to try and scale the image, unfortunately none have yet to work...

any ideas?
manuel
Manuel Contreras
Regular Advisor

Re: convert pdf to pcl w/ghostscript...

Now that I can convert pdf to pcl and print, I would like to write something to recognize the file TO BE printed.

I was thinking that I could utilize the "file" command, as pdf files/output (regardless of file extention) indicates "lex command text"...

$ file tps_tcdockinv_format.pdf
tps_tcdockinv_format.pdf: lex command text


Is there another way to determine that a file is a PDF file?

thanks,
manuel