SourceForge Logo hpinkjet.sourceforge.net

Hewlett-Packard Co. Inkjet Driver Project

The Hewlett-Packard Inkjet Driver Project is a add-on to the GNU Ghostscript application. This driver is open source software based on the Hewlett Packard Appliance Printing Development Kit APDK for deskjet printers.

Table of contents


1 Overview

The Hewlett-Packard Inkjet Driver Project (HPIJS) is a add-on printer driver for GNU Ghostscript. This driver is open source software based on the Hewlett-Packard Appliance Printing Development Kit APDK for deskjet printers. The driver will take RGB rasters from Ghostscript and converts them to printer-ready-bits.

Ghostscript uses a generalized IPC interface for HPIJS communications. This interface is called the IJS interface. The IJS interface, which was written by Raph Levien of Ghostscript, was inspired by the first HPIJS interface. The IJS interface can be used by any printer manufacturer.

There are two parts to the IJS interface - IJS client that resides in GNU Ghostscript and the IJS server. The IJS server is built into the printer driver, in our case the HP Inkjet driver. In this document the term IJS server, HPIJS server, HPIJS, or HP Inkjet Driver are all synonymous. They all refer to the same software component. HPIJS runs as a server or co-process to GNU Ghostscript. The server is spawned automatically by GNU Ghostscript. The following figure is a high level overview of the IJS interface between GNU Ghostscript and HPIJS.

GNU Ghostscript is a software application that interprets PostScript and displays the results on the screen or converts the PostScript into a form you can print on a non-PostScript printer.

PostScript is a programming language optimized for printing graphics and text, it is sometimes called a page description language. Most Linux applications support PostScript. Postscript is the standard for printing in any Linux or Unix environment.

Ghostscript supports many output devices, including many different printers. This document addresses how to build, install and use HPIJS with Ghostscript. This document is intended for distributions and experienced users. Other users should refer to their appropriate Linux distribution for HPIJS support.

Although HPIJS runs as a separate process from Ghostscript, HPIJS still looks like just another Ghostscript printer driver. Adding printer drivers is a well documented interface that is described in the GNU Ghostscript documentation at http://www.cs.wisc.edu/~ghost/doc/gnu/index.htm. Together with Ghostscript and HPIJS, PostScript can be converted to a printer language that is compatible with many of the latest HP printer products. See Installation on how to download and install HPIJS.

HPIJS supports both the new IJS interface and the old HPIJS interface. Support for the HPIJS interface is provided for backward compatibility only. All new features will be supported on the IJS interface only. This document only addresses how to use HPIJS using the IJS interface. The old HPIJS interface is defined in the HPIJS 0.97 release. More information on the IJS interface can be found at inkjet-list.

Ghostscript is not a gui application. Ghostscript is a command line application that runs from a Linux shell, similar to a Microsoft DOS command run from a DOS window.

Ghostscript can be used by itself to print to a non-Postscript printer, but generally a print spooler must be used. The print spooler must be configured to use Ghostscript when printing to a non-Postscript printer. Many Linux distributions all ready support HPIJS in their spooler system, see their web site for spooler support questions. Additional information is available at www.linuxprinting.org.


2 License

GNU Ghostscript uses the GNU General Public License (GPL) and the IJS interface uses the MIT License. After HPIJS 1.0.1 the driver uses a BSD license. HPIJS 1.0 and below uses a BSD type license with a "HP product only" clause.

3 System Requirements

HPIJS works with GNU Ghostscript 6.53 or higher. The HPIJS download includes all the necessary files to build the HP Inkjet Driver from source code. Since the current Ghostscript release now has built-in support for the IJS interface, no other Ghostscript files are necessary to run HPIJS.

HPIJS is platform-independent and works on many different Unix and Linux systems. In order to install HPIJS the download includes an automake/autoconf makefile. This portable build procedure requires an ANSI C compiler, ANSI C++ compiler and a POSIX compliant environment.

This version of HPIJS supports both the new IJS interface and the old HPIJS interface. HPIJS requires Ghostscript to support one of these two interfaces.

HPIJS 2.1 and higher requires libjpeg and libjpeg-devel support.

HPIJS emits standard file output. The output can be directed to a file or to the actual device via the parallel or USB port. Some all-in-one devices, such as OfficeJets require the HP Linux OfficeJet Driver (HPOJ). In this case HPIJS output is sent to HPOJ and then the data is passed to the actual device.

Many platforms (Red Hat, Mandrake, SUSE, Yellow Dog, FreeBSD, Debian, HPUX, AIX, etc) have been confirmed to work, please see those sites for more information.


4 Driver Support

There are currently more than 230 HP printer models supported with HPIJS. HP printer support is defined by the current Hewlett Packard Appliance Printing Development Kit APDK. See the APDK documentation at http://hpapdk.com for more information.

HPIJS supports all the current HP printer models with different Ghostscript command line parameters. Different printer models can be selected with the IEEE 1284 Manufacturer and Model strings. This information can come from the query of a printer over the parallel or usb port.

The following Ghostscript commands are required when using HPIJS.

  -sDEVICE=ijs
  -sIjsServer=hpijs
  -dIjsUseOutputFD
  -sDeviceManufacturer=x   (x equals: "HEWLETT-PACKARD", "HP", "APOLLO")
  -sDeviceModel=x          (x equals: "DESKJET 990", "DESKJET 670", etc...)
The following Ghostscript commands are optional when using HPIJS.
  -dDuplex=false -dTumble=false (none)
  -dDuplex=true  -dTumble=false (book)
  -dDuplex=true  -dTumble=true  (tablet)

  -sIjsParams="Quality:Quality=n,Quality:ColorMode=n,Quality:MediaType=n,
               Quality:PenSet=n,Quality:FullBleed=n,PS:MediaPosition=n"

      Quality equals: 0=normal (default), 1=draft, 2=best, 3=hires, 4=fastdraft
      ColorMode equals: 0=grey_k, 1=grey_cmy, 2=color (default)
      MediaType equals: 0=plain (default), 1=premium, 2=photo
      PenSet equals: 0=black_pen, 1=color_pen, 2=both_pens, 3=mdl_pen, 4=mdl_both
      FullBleed equals: 0=no (default), 1=yes
      MediaPosition equals: 1=upper_tray, 4=lower_tray, 7=autoselect (default) 
PenSet Definitions
  black_pen: only black pen in the printer
  color_pen: only color pen in the printer
  both_pens: black & color pens in printer
  mdl_pen: photo pen in the printer
  mdl_both: color pen and photo pen in printer
Note, there are defaults for all optional commands. PenSet default is defined by each device class.

The Quality, MediaType, ColorMode, PenSet and FullBleed are used to set the print mode. Not all combinations of Quality, MediaType, ColorMode, PenSet and FullBleed are valid print modes. If an invalid print mode is set, the job will still print, because HPIJS will default to a print mode that makes sense given the input. HPIJS will send any error message to stderr and syslog. Print modes are device class specific, see the following device descriptions for more details.

MediaPosition can be any valid PCL Media Source value. MediaPositon defaults to "autoselect" which means the printer will decide which tray to use. MediaPosition is recognized by DJ9xxVIP, DJGenericVIP and HP LaserJet only. All other device classes ignore this command.

4.1 Device Descriptions

HPIJS is a monolithic driver that supports many different printers. Common printers are divided into different device classes. Each device class share common printer attributes such as print modes and paper sizes. HPIJS will automatically map the DeviceModel parameter to one of the devices classes.

The following devices classes are currently supported by HPIJS. Each device class support 300x300dpi unless specified otherwise. The DeviceModel parameters listed for each device class are case sensitive.

Note, the DeviceModel parameters listed above for each device class are not the full Model string returned by a IEEE 1284 Device ID query. When HPIJS maps the DeviceModel to a device class, the match is wild-carded and trailing characters are ignored.

For example, a Device ID query on a Deskjet 990Cxi will return "DESKJET 990C". If DeviceModel="DESKJET 990C", HPIJS will match to "DESKJET 99", ignore the "0C" and select the DJ9xxVIP device class. See the proxy table for each device class (ie: dj9xxvip.cpp) for a list of model strings and how they are wild-carded.

4.2 Paper Sizes

For device classes that support PCL encapsulation, the paper size command is determined automatically. HPIJS selects the paper size based on the physical paper size set by Ghostscript. The following standard paper sizes are supported by HPIJS.
                              inches:      postscript units:
  1. Letter                  8.5 x 11          612 x 792
  2. Legal                   8.5 x 14          612 x 1008
  3. Ledger                   11 x 17          792 x 1224
  4. Executive              7.25 x 10.5        522 x 756
  5. A3                    11.69 x 16.53       842 x 1190
  6. A4                     8.27 x 11.69       595 x 842
  7. A5                     5.83 x 8.27        420 x 595
  8. A6                     4.13 x 5.83        297 x 420 
  9. Photo                     4 x 6           288 x 432 
 10. B4                   10.126 x 14.342      729 x 1033 
 11. B5                     7.17 x 10.126      516 x 729
 12. Oufuku-Hagaki          5.83 x 7.87        420 x 567
 13. Hagaki                 3.94 x 5.83        284 x 420
 14. Super B                  13 x 19          936 x 1368
 15. Flsa                    8.5 x 13          612 x 936
 16. Number 10 Envelope     4.12 x 9.5         297 x 684
 17. A2 Envelope            4.37 x 5.75        315 x 414
 18. C6 Envelope            4.49 x 6.38        323 x 459
 19. DL Envelope            4.33 x 8.66        312 x 624
 20. Japanese Envelope #3   4.72 x 9.25        340 x 666
 21. Japanese Envelope #4   3.54 x 8.07        255 x 581

If the paper size is not one of the above standard papers sizes HPIJS will default to a custom paper size. Most printers are capable of printing custom-sized media of any dimension provided it conforms to the minimum and maximum paper size definition in the product specification. For example on a Deskjet 990, the minimum paper size is 3x5 inches and the maximum paper size is 8.5x14 inches.

All device classes support custom papers sizes. Although HPIJS does not explicitly support the following printer models, custom-sized media are not supported on - DJ340, DJ500, DJ500C, DJ510, DJ520, DJ550C and DJ560C.


4.3 Printable Area

Printable area or margins are device class and print mode dependent. For example inkjet products, when Duplex mode is set the top margin is set to 1/2 inch. Normally the top margin is 1/8 inch. Laserjet products do not have different margins during duplex. Printers that support full bleed will require a slightly oversize printable width and height to account for over spray and paper skew.

The printable area values are available over the IJS interface. Ghostscript uses this data during postscript to raster conversion.

The following table lists the physical printable area for all paper sizes supported by HPIJS. Custom (8.5 x 12) is a custom paper size example.

Device Class Paper (inches) Normal Duplex Full Bleed
Left Top Width Height Left Top Width Height Left Top Width Height
DJ350
DJ540
DJ630
DJ6xx
DJ6xxPhoto
AP2xxx
AP21xx
AP2560
Letter (8.5x11) 0.25 0.125 8 10.205 n/a n/a n/a n/a n/a n/a n/a n/a
A4 (8.27x11.69) 0.135 0.125 8 10.895 n/a n/a n/a n/a n/a n/a n/a n/a
Legal (8.5x14) 0.25 0.125 8 13.205 n/a n/a n/a n/a n/a n/a n/a n/a
Photo (4x6) 0.25 0.125 3.5 5.205 n/a n/a n/a n/a n/a n/a n/a n/a
A6 (4.13x5.83) 0.25 0.125 3.63 5.035 n/a n/a n/a n/a n/a n/a n/a n/a
B4 (10.126x14.342) 0.25 0.125 9.626 13.547 n/a n/a n/a n/a n/a n/a n/a n/a
B5 (7.17x10.126) 0.25 0.125 6.67 9.331 n/a n/a n/a n/a n/a n/a n/a n/a
Oufuku-Hagaki (5.83x7.87) 0.25 0.125 5.33 7.075 n/a n/a n/a n/a n/a n/a n/a n/a
Hagaki (3.94x5.83) 0.25 0.125 3.44 5.035 n/a n/a n/a n/a n/a n/a n/a n/a
A3 (11.69x16.53) 0.25 0.125 11.19 15.735 n/a n/a n/a n/a n/a n/a n/a n/a
A5 (5.83x8.27) 0.25 0.125 5.33 7.475 n/a n/a n/a n/a n/a n/a n/a n/a
Ledger (11x17) 0.25 0.125 10.5 16.205 n/a n/a n/a n/a n/a n/a n/a n/a
Super B (13x19) 0.25 0.125 12.5 18.205 n/a n/a n/a n/a n/a n/a n/a n/a
Executive (7.25x10.5) 0.25 0.125 6.75 9.705 n/a n/a n/a n/a n/a n/a n/a n/a
Flsa (8.5x13) 0.25 0.125 8 12.205 n/a n/a n/a n/a n/a n/a n/a n/a
Custom (8.5x12) 0.25 0.125 8 11.205 n/a n/a n/a n/a n/a n/a n/a n/a
Number 10 Envelope (4.12x9.5) 0.25 0.125 3.62 8.705 n/a n/a n/a n/a n/a n/a n/a n/a
A2 Envelope (4.37x5.75) 0.25 0.125 3.87 4.955 n/a n/a n/a n/a n/a n/a n/a n/a
C6 Envelope (4.49x6.38) 0.25 0.125 3.99 5.585 n/a n/a n/a n/a n/a n/a n/a n/a
DL Envelope (4.33x8.66) 0.25 0.125 3.83 7.865 n/a n/a n/a n/a n/a n/a n/a n/a
Japanese Envelope #3 (4.72x9.25) 0.25 0.125 4.22 8.455 n/a n/a n/a n/a n/a n/a n/a n/a
Japanese Envelope #4 (3.54x8.07) 0.25 0.125 3.04 7.275 n/a n/a n/a n/a n/a n/a n/a n/a
DJ8xx
DJ8x5
DJ850
DJ890
DJ3320
Letter (8.5x11) 0.25 0.125 8 10.375 n/a n/a n/a n/a n/a n/a n/a n/a
A4 (8.27x11.69) 0.135 0.125 8 11.065 n/a n/a n/a n/a n/a n/a n/a n/a
Legal (8.5x14) 0.25 0.125 8 13.375 n/a n/a n/a n/a n/a n/a n/a n/a
Photo (4x6) 0.125 0.125 3.75 5.75 n/a n/a n/a n/a n/a n/a n/a n/a
A6 (4.13x5.83) 0.125 0.125 3.88 5.205 n/a n/a n/a n/a n/a n/a n/a n/a
B4 (10.126x14.342) 0.25 0.125 9.626 13.717 n/a n/a n/a n/a n/a n/a n/a n/a
B5 (7.17x10.126) 0.25 0.125 6.67 9.5 n/a n/a n/a n/a n/a n/a n/a n/a
Oufuku-Hagaki (5.83x7.87) 0.25 0.125 5.33 7.37 n/a n/a n/a n/a n/a n/a n/a n/a
Hagaki (3.94x5.83) 0.125 0.125 3.69 5.58 n/a n/a n/a n/a n/a n/a n/a n/a
A3 (11.69x16.53) 0.2 0.125 11.29 15.905 n/a n/a n/a n/a n/a n/a n/a n/a
A5 (5.83x8.27) 0.125 0.125 5.58 7.645 n/a n/a n/a n/a n/a n/a n/a n/a
Ledger (11x17) 0.2 0.125 10.6 16.375 n/a n/a n/a n/a n/a n/a n/a n/a
Super B (13x19) 0.2 0.125 12.6 18.375 n/a n/a n/a n/a n/a n/a n/a n/a
Executive (7.25x10.5) 0.25 0.125 6.75 9.875 n/a n/a n/a n/a n/a n/a n/a n/a
Flsa (8.5x13) 0.25 0.125 8 12.375 n/a n/a n/a n/a n/a n/a n/a n/a
Custom (8.5x12) 0.25 0.125 8 11.375 n/a n/a n/a n/a n/a n/a n/a n/a
Number 10 Envelope (4.12x9.5) 0.1225 0.125 3.875 8.875 n/a n/a n/a n/a n/a n/a n/a n/a
A2 Envelope (4.37x5.75) 0.125 0.125 4.12 5.125 n/a n/a n/a n/a n/a n/a n/a n/a
C6 Envelope (4.49x6.38) 0.125 0.125 4.24 5.755 n/a n/a n/a n/a n/a n/a n/a n/a
DL Envelope (4.33x8.66) 0.125 0.125 4.08 8.035 n/a n/a n/a n/a n/a n/a n/a n/a
Japanese Envelope #3 (4.72x9.25) 0.125 0.125 4.47 8.625 n/a n/a n/a n/a n/a n/a n/a n/a
Japanese Envelope #4 (3.54x8.07) 0.125 0.125 3.29 7.445 n/a n/a n/a n/a n/a n/a n/a n/a
DJ9xx
DJ9xxVIP
Letter (8.5x11) 0.25 0.125 8 10.375 0.25 0.5 8 10 n/a n/a n/a n/a
A4 (8.27x11.69) 0.135 0.125 8 11.065 0.135 0.5 8 10.69 n/a n/a n/a n/a
Legal (8.5x14) 0.25 0.125 8 13.375 0.25 0.5 8 13 n/a n/a n/a n/a
Photo (4x6) 0.125 0.125 3.75 5.75 0.125 0.5 3.75 5 n/a n/a n/a n/a
A6 (4.13x5.83) 0.125 0.125 3.88 5.205 0.125 0.5 3.88 4.83 n/a n/a n/a n/a
B4 (10.126x14.342) 0.25 0.125 9.626 13.717 0.25 0.5 9.626 13.342 n/a n/a n/a n/a
B5 (7.17x10.126) 0.25 0.125 6.67 9.5 0.25 0.5 6.67 9.126 n/a n/a n/a n/a
Oufuku-Hagaki (5.83x7.87) 0.25 0.125 5.33 7.37 0.25 0.5 5.33 6.87 n/a n/a n/a n/a
Hagaki (3.94x5.83) 0.125 0.125 3.69 5.58 0.125 0.5 3.69 4.83 n/a n/a n/a n/a
A3 (11.69x16.53) 0.2 0.125 11.29 15.905 0.2 0.5 11.29 15.53 n/a n/a n/a n/a
A5 (5.83x8.27) 0.125 0.125 5.58 7.645 0.125 0.5 5.58 7.27 n/a n/a n/a n/a
Ledger (11x17) 0.2 0.125 10.6 16.375 0.2 0.5 10.6 16 n/a n/a n/a n/a
Super B (13x19) 0.2 0.125 12.6 18.375 0.2 0.5 12.6 18 n/a n/a n/a n/a
Executive (7.25x10.5) 0.25 0.125 6.75 9.875 0.25 0.5 6.75 9.5 n/a n/a n/a n/a
Flsa (8.5x13) 0.25 0.125 8 12.375 0.25 0.5 8 12 n/a n/a n/a n/a
Custom (8.5x12) 0.25 0.125 8 11.375 0.25 0.5 8 11 n/a n/a n/a n/a
Number 10 Envelope (4.12x9.5) 0.1225 0.125 3.875 8.875 0.1225 0.5 3.875 8.5 n/a n/a n/a n/a
A2 Envelope (4.37x5.75) 0.125 0.125 4.12 5.125 0.125 0.5 4.12 4.75 n/a n/a n/a n/a
C6 Envelope (4.49x6.38) 0.125 0.125 4.24 5.755 0.125 0.5 4.24 5.38 n/a n/a n/a n/a
DL Envelope (4.33x8.66) 0.125 0.125 4.08 8.035 0.125 0.5 4.08 7.66 n/a n/a n/a n/a
Japanese Envelope #3 (4.72x9.25) 0.125 0.125 4.47 8.625 0.125 0.5 4.47 8.25 n/a n/a n/a n/a
Japanese Envelope #4 (3.54x8.07) 0.125 0.125 3.29 7.445 0.125 0.5 3.29 7.07 n/a n/a n/a n/a
DJ3600 Letter (8.5x11) 0.25 0.125 8 10.375 n/a n/a n/a n/a 0.25 0.125 8 10.375
A4 (8.27x11.69) 0.135 0.125 8 11.065 n/a n/a n/a n/a 0.135 0.125 8 11.065
Legal (8.5x14) 0.25 0.125 8 13.375 n/a n/a n/a n/a 0.25 0.125 8 13.375
Photo (4x6) 0.125 0.125 3.75 5.75 n/a n/a n/a n/a 0 0 4.216 6.174
A6 (4.13x5.83) 0.125 0.125 3.88 5.205 n/a n/a n/a n/a 0 0 4.346 5.33
B4 (10.126x14.342) 0.25 0.125 9.626 13.717 n/a n/a n/a n/a 0.25 0.125 9.626 13.717
B5 (7.17x10.126) 0.25 0.125 6.67 9.5 n/a n/a n/a n/a 0.25 0.125 6.67 9.5
Oufuku-Hagaki (5.83x7.87) 0.25 0.125 5.33 7.37 n/a n/a n/a n/a 0 0 6.046 7.37
Hagaki (3.94x5.83) 0.125 0.125 3.69 5.58 n/a n/a n/a n/a 0 0 4.156 5.33
A3 (11.69x16.53) 0.2 0.125 11.29 15.905 n/a n/a n/a n/a 0.2 0.125 11.29 15.905
A5 (5.83x8.27) 0.125 0.125 5.58 7.645 n/a n/a n/a n/a 0.125 0.125 5.58 7.645
Ledger (11x17) 0.2 0.125 10.6