hdpj: a Ghostscript Device Driver for PCL 3+

# hpdj

## Overview

1. Ghostscript
2. hpdj
3. Alternatives to hpdj

## Ghostscript

### What is Ghostscript?

Ghostscript is a PostScript interpreter, i.e., a program accepting a PostScript file as input and generating a representation of it in another format. Ghostscript was designed and is maintained by L. Peter Deutsch of Aladdin Enterprises, California.

### Ghostscript's Basic Architecture

Ghostscript is divided into a kernel, which understands PostScript, and so-called device drivers. The latter are called from the kernel to do basic drawing operations and to ship out completed pages, usually in a format specific to the driver.

Device drivers are currently not separately loadable but have to be compiled into the program. Therefore, if you want to change the set of drivers contained in your ghostscript executable you have to recompile it.

### Ghostscript Distributions

Ghostscript source code is distributed in two forms: as Aladdin ghostscript and as GNU ghostscript. A GNU ghostscript distribution is a re-issue of an Aladdin ghostscript distribution with less restrictions on commercial (re-)distribution. Both use the same version numbers.

The intention is apparently to have a gap of at least a year between corresponding releases in these two series. Note that because of intervals between Aladdin releases and because not all Aladdin versions are released as GNU distributions, the extent to which the current GNU distribution is out of date can be much larger; in spring 1998 immediately before GNU gs 4.03 this amounted to two and a half years.

Ghostscript distributions can be found on a number of FTP servers. In addition, most free UNIX distributions contain a ghostscript distribution, sometimes with an extended set of device drivers.

### More Information on Ghostscript

The main WWW resource for ghostscript is http://www.cs.wisc.edu/~ghost. It tells you what the current version of ghostscript is, how to obtain it, and what other programs and pieces of information are of interest in this context.

In addition, every ghostscript distribution contains extensive documentation.

## hpdj

### What is hpdj?

hpdj is a ghostscript device driver for printers understanding Hewlett-Packard's Printer Command Language, level 3+ (PCL 3+, also called "PCL 3 Plus" or "PCL 3 enhanced"). This applies in particular to some but not all HP DeskJet printers. Because of the "but not all" part in the last sentence and in order to avoid misunderstandings, hpdj will be renamed in its next major release (probably to pcl3).

The main design goals of this driver were maintainability, reliability, and support for "new" DeskJets, starting with the HP DeskJet 540.

To give a first impression regarding maintainability, the ratio of comment lines to netto lines of code is roughly 2.6 times as high in hpdj as on average in ghostscript. Reliability is mainly achieved by strict adherence to HP's official documentation, as far as it can be obtained. Unfortunately, the information offered by Hewlett-Packard is not as up-to-date as I could wish. However, it seems that I have achieved my goal in this respect because of the few bug reports I have received since hpdj's first public beta release in March 1997 (hpdj 2.0) none was concerned with the generated PCL code. The driver has also turned out to be able to support a gratifyingly large number of PCL-3+ printer models beyond those for which it was written. There is, however, an increasing number of cases where newer PCL-3+ printers use language features I have no documentation for.

The code lists all the documentation used in order to enable everyone to inspect the driver's quality.

### Features

The main features of hpdj are:

- Extensive user documentation
- Support for different printer models. The driver has special knowledge about all series-500 and some series-800 HP DeskJets, plus generic support for other PCL-3+ printers.
- Variable resolution
- Variable print quality (draft, normal, presentation)
- Variable media type (plain paper, ..., transparencies, ...)
- Monochrome, CMY, CMY+K and CMYK printing
- Support for the hardware part of HP's Color Resolution Enhancement technology (C-REt)
- Page counting across invocations (useful to determine ink costs per page; the distribution also contains an example of a BSD spooler input filter using this feature to collect data for user-specific print accounting)
- Open to the usual device-specific configuration in PostScript (e.g., transfer functions and halftone screens)
- More support for media handling than usual in almost all ghostscript drivers (recognition of media sizes from the document, adaptation to landscape orientation as required by the PostScript language definition).

hpdj does not support different resolutions for black and CMY colorants, i.e., there is no combined 600 ppi black + 300 ppi CMY mode, and it does not support photo cartridges.

### Supported Printers

hpdj was in particular intended for the following printers:

- HP DeskJet 500
- HP DeskJet 500C
- HP DeskJet 510
- HP DeskJet 520
- HP DeskJet 540
- HP DeskJet 550C
- HP DeskJet 560C
- HP DeskJet 850C
- HP DeskJet 855C

So much for the theory. I have received reports that hpdj works at least basically with the following printer models:

- HP DeskJet 340
- HP DeskJet 500
- HP DeskJet 500C (tested for monochrome only)
- HP DeskJet 520
- HP DeskJet 540
- HP DeskJet 560C
- HP DeskJet 600
- HP DeskJet 660C/660Cse
- HP DeskJet 670C
- HP DeskJet 672C
- HP DeskJet 680C
- HP DeskJet 690C
- HP DeskJet 690C+
- HP DeskJet 693C
- HP DeskJet 694C
- HP DeskJet 850C
- HP DeskJet 855C
- HP DeskJet 870Cse/870Cxi
- HP DeskJet 880C
- HP DeskJet 890C
- HP DeskJet 895Cse/895Cxi
- HP DeskJet 1100C
- HP DeskJet 1120C
- HP OfficeJet 590
- HP OfficeJet 600
- HP OfficeJet 625
- HP 2000C/Cse/CN Professional Series Color Printer
- Lexmark 3000 Color Jetprinter

At least one Olivetti printer (Olivetti JP792) can be made to work with hpdj by changing the order in which bit planes are sent to the printer from KCMY to CMYK (which is not valid PCL). For the moment, you'll have to modify hpdj's source code for this.

My impression is that every PCL-3-conforming printer can be made to print with hpdj, but at least in colour the resulting quality is not always as good as it could be. This is partly due to a deliberate design decision (use of standard ghostscript features for rendering), but I have also been told that newer printers (e.g., the DJ 895C) produce wrong colours if one is using hpdj with C-REt (more than two intensity levels per colorant). The source of this problem is still unclear.

You should be aware that Hewlett-Packard does not only produce PCL-3+ ink jet printers. If the printer's documentation does not say anything about its printer command language or you find a statement like "... is designed for Microsoft Windows" or "DOS support through Windows only", the printer is almost certainly using HP's Printing Performance Architecture (PPA) commands and is intended exclusively for systems running Microsoft Windows. Nevertheless, there exist at least two possibilities to at least basically use a PPA printer with ghostscript: see ftp://ftp.ig.utexas.edu/outgoing/scottk/820C and http://www.httptech.com/ppa.

### Availability

hpdj is free software, available under the terms of the GNU Library General Public License (LGPL), Version 2. The main location for hpdj is the directory ftp://ftp.sbs.de/pub/graphics/ghostscript/pcl3. Look for files named `hpdj-version.tar.gz`.

I am distributing this driver only in the form of gzipped tar archives. If you wish to compile hpdj on a non-UNIX platform, you need gzip, tar (on systems running Microsoft Windows you can use the Cygnus port of the GNU tools), and a command to convert text files from LF-terminated lines to whatever the line termination conventions are on your system.

I have occasionally been asked why hpdj is not part of the main ghostscript distributions. I offered it to L. Peter Deutsch twice, in September 1996 and in March 1997, but he declined on both occasions although he was also dissatisfied with the existing PCL-3 drivers. The first time hpdj did not yet contain colour support (actually, he offered to pay me for implementing a fully usable DeskJet driver, but I in turn declined because I wished to distribute the driver under a GNU license), and the second time he would have preferred an integration with the uniprint driver because there are already so many ink jet drivers. These considerations did, however, not stop him from including the make configuration for Uli Wortmann's new DeskJet driver in the official gs distribution shortly afterwards. This suggests that he has other reasons than those stated for not being interested in hpdj. (Although he at least added a reference to hpdj in new-user.txt in gs 5.01, this was silently removed some time after 5.10 and before 5.50.) I have given up on this point.

If you want to use hpdj you will therefore usually have to fetch it separately and to recompile ghostscript. By now, however, several free UNIX distributions (S.u.S.E. Linux, FreeBSD and Debian Linux) include hpdj in their newer ghostscript packages as a matter of course.

### Disclaimer

I do not offer any guarantee that this driver is harmless for your printer, your cat's life, or the future of the universe. USE IT AT YOUR OWN RISK!

In addition, I should explicitly mention that my employer has nothing to do with this software (no rights, no responsibilities).

## Alternatives to hpdj

hpdj is not the only ghostscript driver generating PCL 3+.

Every current ghostscript distribution contains several drivers with this property, in particular the cdj series for some of the DeskJet 500 series printers. However, as my dissatisfaction with these drivers was the reason I developed hpdj, I cannot honestly recommend them. Other people might have a different opinion, though.

Uli Wortmann has modified the cdj driver for in particular the HP DeskJet 850C. His cdj850 driver is available from http://www.erdw.ethz.ch/~bonk.

Gunther Hess has written the uniprint driver which is included in ghostscript distributions since version 4.70. It was intended to become a universal driver for ink jet printers and evolved from the cdj drivers via the stcolor driver.

If you are unable to find a driver satisfying your requirements among these choices, you can of course always write a new one. This is, however, not a simple task.

Last update: $Date: 1999-10-16 14:20:53+02 $