Setting a Tiff Printer for Windows Using GhostScript

Oved Blass,oved@nethost.co.il

NetHost - Web Hosting Services

July 2003

General

This document shows how to set up a Tiff printer on Windows, a virtual printer that prints to a tiff image file. Two software tools are used to create the tiff printer:

Both programs are from the authors of GhostScript which had a similar problem in mind, while writing RedMon (Creating a printer that prints to PDF files or printing PostScript files to a printer that does not support PostScript).

The Tiff printer that is described here works by creating a virtual printer that prints to a PostScript file and then, converting this file to Tiff using GhostScript. The process is transparent and the end result is that when you print to this Tiff printer, a tiff file with the printout is created in few seconds. It is possible to convert the initial PostScript file to other formats such as PDF using GhostScript or another converter.

In order to create a tiff printer we will use the following steps:

Install GhostScript and RedMon

GhostScript for windows is available at http://www.cs.wisc.edu/~ghost/

RedMon can be found at http://www.cs.wisc.edu/~ghost/redmon/index.htm

Download these two software tools and install them on your computer.

We assume here that GhostScript was installed in c:\gs and RedMon files were copied to c:\gstools (and that you have also installed RedMon by running it's setup program). If you have installed the software in another location, take care to use that location instead of the paths that are described here.

Create a PostScript Virtual Printer

Amir Hertzberg describes here how to create in Windows a virtual printer that prints to a PostScript file, using the generic printer driver MS Publisher ImageSetter. Follow his instructions at the section "Creating PostScript using Windows Office Applications" to properly create a PostScript printer. After you have created the printer you can change it's name to Tiff Printer.

Creating a convenient GhostScript to Tiff convert command

Create a text file c:\gstools\tif.rsp with the following text.

-Ic:\gs\gs8.00\lib;c:\gs\fonts

-sDEVICE=tiffg4

-sOutputFile=c:\print.tif

-dNOPAUSE

-dSAFER

-dBATCH

-sPAPERSIZE=a4

These are the command line options of GhostScript for PostScript to Tiff conversion. It is more convenient to have these option in a separate file than to specify a very long command in the virtual printer options.

The file c:\print.tif is the eventual tif printout file that will be created whenever you print to the virtual printer.

Set the Virtual Printer to Convert PostScript to Tiff After Every Print

Open Printers and Faxes

Select the virtual PostScript printer you have created earlier.

Select File->Properties to view the printer properties (see window snapshot below)

Set the port for the printer to RPT1 which is the port that RedMon software created. If it does not exist, create it using the Add Port button and then choose Redirected Port as the port type (this type is created by the RedMon software)

Configure Ports

Set the configuration options for the port to:

Redirect this port to the program: C:\gs\gs8.00\bin\gswin32c.exe

Arguments for this program are: @c:\gstools\tif.rsp -

(See window snapshot below for example) Pay attention that there is a hyphen at the end of the Arguments for this program field.

Port Configuration

Using the Tiff Printer

To print to the tiff printer, simply choose the printer that you have created when printing. Usually a window will appear for a short time while printing. This is the GhostScript conversion program. When the printing completes, you will find the file c:\print.tif with the printout. Note that printing will fail if this file is opened in another program. Each print replaces the c:\print.tif file with a new print image.

How to Set up a printer that prints to PDF file

With a slight modification we can create another printer that prints to a PDF file c:\print.pdf

We will need to create a new printer that will print to another Redirected Port, the printer type is the same as we created for the tif printer (Generic - MS Image Setter).

After we created the printer and added special RPT port for it, we will need configure the port with setting similar to the window snapshot below

PDF Port Properties

The file pdf.rsp contains the GhostScript command options for converting PostScript to PDF:

-Ic:\gs\gs8.00\lib;c:\gs\fonts

-sDEVICE=pdfwrite

-sOutputFile=c:\print.pdf

-dNOPAUSE

-dSAFER

-dBATCH

-sPAPERSIZE=a4

Note that it is possible to add more options that control the way the PDF file is created with GostScript. For example it is possible to set the page size to Legal.

References

GhostScript and RedMon documentation

Amir Hertzberg's how to setup a PostScript printer

Commercial Alternatives

Some companies offer commercial tiff print driver and related software:

Informatic Inc. offers Image Driver at http://www.informatik.com/

ImageMAKER Development Inc at http://www.imgmaker.com/

BlackIce Software at http://www.blackice.com offers Monochrome Tiff Printer Driver