Understanding Ghostscript Drivers

To delve more deeply into Linux printer configuration, it's necessary to understand more about Ghostscript. Ghostscript is essentially a third-party implementation of PostScript. Unlike the third-party PostScript interpreters you find in many printers, Ghostscript runs on your computer. You can use it to view PostScript files on your screen or to print PostScript files on nonPostScript printers. You can find the latest version of Ghostscript, including complete documentation, at http://www.cs.wisc.edu/~ghost.

Note

Ghostscript comes in two forms. One, Aladdin Ghostscript, is the latest version. Aladdin Ghostscript is free for most uses, but cannot be included in any package for which money is charged without paying license fees to Aladdin. After a given version of Aladdin Ghostscript has been out for a while, the company changes its license to the GNU General Public License (GPL), which permits wider distribution. For this reason, Linux distributions ship with GNU Ghostscript, as this older version is called. In most cases, GNU Ghostscript is adequate, but if you want the latest features, you must obtain Aladdin Ghostscript from its main Web site or from some other site.

Ghostscript includes a large number of drivers for an assortment of printers, displays, and graphics file formats. These drivers must be compiled into the Ghostscript binary file, so to save space, most binary versions of Ghostscript omit some of the drivers. You can find out which drivers your version includes by typing gs -help. This results in output that includes a list of drivers with names such as epson, laserjet, stcolor, pcx256, pngmono, and pdfwrite.

Unfortunately, the Ghostscript device names can be somewhat cryptic, so you might need to consult some helpful resource to learn what device to use with your printer. The single most helpful such resource is the Printing HOWTO Support Database at

http://www.picante.com/~gtaylor/pht/printer_list.cgi. This Web site includes a search engine that lets you find comments on specific models of printer, including the Ghostscript driver you need to use with a given printer.

If you find that your binary of Ghostscript doesn't include support for your printer, you must locate another binary of Ghostscript or compile your own. The latter is an extremely tedious proposition, so I recommend you hunt for a binary that includes the appropriate support. Check the Ghostscript binaries at http://rufus.w3.org/linux/RPM/ or http://www.debian.org/distrib/packages for RPM or Debian packages, respectively. I've also found the binary RPMs of Ghostscript 5.10 at http://www.users.dircon.co.uk/ -typhoon/ to be very complete, although now that Ghostscript 6.0 is out, this source might not be as appealing.

If you find that you must recompile Ghostscript from scratch, you should read the instructions that come with the source code completely. Ghostscript is particularly tricky to configure to recompile, so it's important that you understand the process fully before you begin.

You can check basic Ghostscript functionality by passing the program a PostScript file. (Several sample PostScript files come with Ghostscript, typically in the /usr/share/ ghostscript/x.yz/examples directory, where x.yz is the Ghostscript version number.) You must specify an output filename, the driver to be used, and various other options, as follows:

gs -dNOPAUSE -dBATCH -q -r100x100 -sDEVICE=png256 -sOutputFile=test.png test.ps

This command creates a PNG file called test.png from the test.ps input file. You can view test.png in a Linux graphics program such as the GIMP. You can change the device driver name and resolution (the -sDEVICE= and -r options, respectively) to match your printer. You can then send the file directly to your printer device, as in cat test.pcl > /dev/lp0

If this results in a good printout, you can configure your printer queue to use Ghostscript with these options.

Was this article helpful?

0 0
Search Engine Optimization Today

Search Engine Optimization Today

Discover How To Get Your Site Ranked On The Top of The Search Engines For Free Targeted Traffic To Your Site. In This Guide You'll Find Out The Ins And Outs of SEO So You Can Finally Get Any Pages Ranked On The First Page of Major Search Engines Like Google And Yahoo.

Get My Free Ebook


Post a comment