FAQ: Using Ghostscript with RPM

Answer: Ghostscript is a PostScript interpreter. PostScript is the most common printer language and is supported by most laser printers from nearly every printer manufacturer. However, there are a number of printers, laser and inkjet both, that do not support PostScript; this is where Ghostscript becomes useful.

The most common reason to use Ghostscript is to convert a PostScript file to PDF. Ghostscript can also output other formats including graphics formats (PNG, JPEG, TIFF, etc.) and printer formats (PCL5, PXL, epson). The second most common reason to use Ghostscript is to print PostScript files to a printer that does not support it.

Convert Postscript to PDF

  1. In Queue Settings, create a new Filter action.
  2. Next to Command, click Browse and locate gswin32.exe. It may be located in C:\Program Files\gs\gs8.64\bin\.
  3. The Arguments should be:
    -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile="%n%S.pdf" "%s"
  4. Set the Working directory to the folder in which you want the PDF file to be saved. To eliminate many issues, this folder should be local.

Note that the %n and %S are variables (placeholders).  RPM will substitute those values with control file data.  A complete list of available variables is found in the RPM manual under both Filter transforms (page 13) and Filter actions (page17).

Print Postscript to a non-Postscript printer

  1. In Queue Settings, create a new Filter action.
  2. Next to Command, click Browse and locate gswin32.exe. It may be located in C:\Program Files\gs\gs8.64\bin\.
  3. The Arguments should be:
    -dNOPAUSE -dBATCH -sDEVICE=mswinpr2 -sOutputFile="\\spool\<Printer Name>" "%s"

Substitute the name of the printer to which you want to print in place of <Printer Name>. This is the name found in the Printers folder.

Note: Certain situations may prevent gswin32 from completing successfully.  Each of the following methods have proven useful to resolve the problem at one time or another.  We suggest trying each method in the order it appears and testing each change until you find the first method that works.

  • The option -dBATCH tells gswin32 it is running as a batch and should exit when finished.  It has been added to these instructions.
  • Try adding the word 'quit' as the last argument to the command line.
  • Add an Append bytes transform to append the word quit to the end of the data file.  One customer reported this method corrupted PDF Documents when attempting to convert Color PostScript files.
  • Configure your Filter action or transform to terminate idle process after a few seconds.  This option will cause gswin32 to close, but it may not be finished with the conversion.

If you encounter any problems, enter the credentials of the user you are logged on as and select Interact with Desktop. The next time a job is received, the Ghostscript window will be displayed where you can troubleshoot errors. Once resolved, remove the credentials.

Your rating: None Average: 4.5 (2 votes)