hpinkjet.sourceforge.net
Hewlett-Packard Co. Linux Inkjet Driver Project
The Hewlett-Packard Linux Inkjet Driver Project is a add-on to the GNU Ghostscript application.
This driver is based on the Hewlett Packard Appliance Printing Development Kit APDK
for deskjet printers.
Table of contents
1 Overview
The Hewlett-Packard Linux Inkjet Driver Project is a add-on to GNU Ghostscript.
This driver is based on the Hewlett-Packard Appliance Printing Development Kit APDK
for deskjet printers.
There are two parts to the HP Inkjet Driver - glue code that resides in GNU Ghostscript and APDK server.
The APDK runs as a server or coprocess to GNU Ghostscript. The server is spawned automatically by GNU Ghostscript.
This document will refer to the APDK server as the HP Inkjet Server (HPIJS).
The following figure is a high level overview of the interface between GNU Ghostscript and the HP Inkjet Server.
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 add
the Hewlett-Packard Inkjet Driver to the current GNU Ghostscript and how to use it.
The Hewlett-Packard Inkjet Driver is just another printer driver added to GNU Ghostscript.
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 the Inkjet Driver, PostScript can be converted to PCL that is compatible
with many of the latest HP inkjet products. See Building on how to build Ghostscript with
the Inkjet Driver.
GNU 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.
GNU Ghostscript can be used by itself to print to a non-Postscript printer, but generally a print spooler musted be used.
The print spooler must be configured to use Ghostscript when printing to a non-Postscript printer.
Most Linux distributions use a gui application called PrintTool to configure a print spooler.
See Installation on how to install a print spooler for Hewlett Packard supported printers.
2 License
GNU Ghostscript uses the GNU General Public License (GPL) and the glue code uses the GNU Lesser General Public License (LGPL). The HP Inkjet Server has a BSD license with a "HP product only" clause.
3 System Requirements
The Hewlett-Packard Linux Inkjet Driver requires GNU Ghostscript version 5.50 or higher. GNU Ghostscript is
platform-independent and works on many different systems - Unix, Linux, Windows, OS/2 etc. The driver was developed and tested
with GNU Ghostscript 5.50 running with Redhat 6.2 and 7.0.
4 Driver Support
There are currently 34 HP inkjet printer models supported with the GNU Ghostscript/HP Inkjet Server (GS/HPIJS) combination. HP printer support is defined by the current Hewlett Packard Appliance Printing Development Kit APDK. See the APDK documetation at http://hpapdk.com for more information.
GS/HPIJS supports all the current HP printer models with different command line parameters.
GS/HPIJS can be used by itself to print to a HP printer, but generally a print spooler musted be used.
The print spooler must be configured to use Ghostscript when printing to a HP printer.
Most Linux distributions use a gui application called PrintTool to configure a print spooler.
PrintTool allows the "root" user to create a print spool for a specifified printer.
PrintTool configures the print spool with script files that pass the proper command line parameters to GS/HPIJS.
With PrintTool you can configure GS/HPIJS to use the following HP printers.
-
HP - developed DeskJet 630C series - This driver was specifically developed by Hewlett-Packard Co. to optimize the speed
and print quality of the HP DeskJet
630/632C for use in Linux operating systems.
Different print modes can be specified with the Extra GS option "-dPrintMode=n".
Where n equals one of the following values: 0=grayscale, 1=color, 2=normal (default) or 3=photo.
-
HP - developed DeskJet 600C series - This driver was specifically developed by Hewlett-Packard Co. to optimize the speed
and print quality of the HP DeskJet
600, 660C, 670/672C, 670TV, 680/682C, e20 for use in Linux operating systems.
Different print modes can be specified with the Extra GS option "-dPrintMode=n".
Where n equals one of the following values: 0=grayscale, or 1=normal (default).
-
HP - developed DeskJet 600C series photo - This driver was specifically developed by Hewlett-Packard Co. to optimize the speed
and print quality of the HP DeskJet
610/612C, 640/648C,
690/692/693/694/695/697C for use in Linux operating systems.
Different print modes can be specified with the Extra GS option "-dPrintMode=n".
Where n equals one of the following values: 0=grayscale, 1=normal (default), or 2=photo.
-
HP - developed DeskJet 800C series - This driver was specifically developed by Hewlett-Packard Co. to optimize the speed
and print quality of the HP DeskJet
810/812C, 830/832C, 840/842C, 880/882C, 895C
for use in Linux operating systems.
Different print modes can be specified with the Extra GS option "-dPrintMode=n".
Where n equals one of the following values: 0=grayscale, 1=normal (default), 2=photo, or 3=draft.
Resolution setting 600x600 is available for photo mode only.
-
HP - developed DeskJet 900C series - This driver was specifically developed by Hewlett-Packard Co. to optimize the speed
and print quality of the HP DeskJet
930/932C, 950/952C, 970C for use in Linux operating systems.
Duplex printing is not supported.
Different print modes can be specified with the Extra GS option "-dPrintMode=n".
Where n equals one of the following values: 0=grayscale, 1=normal (default), or 2=photo.
Resolution setting 600x600 is available for photo mode only.
-
HP - developed DeskJet 990C - This driver was specifically developed by Hewlett-Packard Co. to optimize the speed
and print quality of the HP DeskJet
990C for use in Linux operating systems.
Duplex printing is not supported.
Different print modes can be specified with the Extra GS option "-dPrintMode=n".
Where n equals one of the following values: 0=grayscale, or 1=normal (default).
Resolution setting 600x600 is available for normal mode only.
5 Building the source code
The following build instructions are for Redhat 6.2 and Redhat 7.0. Since, both Redhat distributions use GNU Ghostscript 5.50, a full
install of GNU Ghostscript 5.50 is not necessary.
- Download the source code for gs, jpeg, png and zlib into the following directories respectfully. See the
GNU Ghostscript
documentation for more information. You can create this directory structure in your user directory. Be sure to
use the following directory names for jpeg, libpng and zlib.
../gs/gs5.50/
../gs/gs5.50/jpeg/
../gs/gs5.50/libpng/
../gs/gs5.50/zlib/
- Download the source code for the HP InkJet Server files here and put them in the
following directory.
../gs/hpijs/
- Copy the following files from ../gs/hpijs/ to the ../gs/gs5.50/ directory.
gdevhpijs.c
contrib.mak
unix-gcc.mak
- Now build GS/HPIJS by running the make command in each of the following directories.
# ../gs/gs5.50/make
# ../gs/hpijs/make
- With the following commands you can make GS/HPIJS the default gs command.
# cp ../gs/gs5.50/obj/gs /usr/bin/
# cp ../gs/hpijs/hpijs /usr/bin/
- You can verify GS/HPIJS was build correctly with the gs -h command.
You should see output similar to this.
GNU Ghostscript 5.50 (2000-2-13)
Copyright (C) 1998 Aladdin Enterprises, Menlo Park, CA. All rights reserved.
Usage: gs [switches] [file1.ps file2.ps ...]
Most frequently used switches: (you can use # in place of =)
-dNOPAUSE no pause after page | -q `quiet', fewer messages
-gx page size in pixels | -r pixels/inch resolution
-sDEVICE= select device | -dBATCH exit after last file
-sOutputFile= select output file: - for stdout, |command for pipe,
embed %d or %ld for page #
Input formats: PostScript PostScriptLevel1 PostScriptLevel2 PDF
Available devices:
x11 x11alpha x11cmyk x11gray2 x11gray4 x11mono DJ630 DJ6xx DJ6xxP DJ8xx
DJ9xx DJ9xxVIP AP21xx deskjet djet500 laserjet ljetplus ljet2p ljet3
ljet4 cdeskjet cdjcolor cdjmono cdj550 pj pjxl pjxl300 uniprint bj10e
bj200 bjc600 bjc800 faxg3 faxg32d faxg4 pcxmono pcxgray pcx16 pcx256
pcx24b pcxcmyk pbm pbmraw pgm pgmraw pgnm pgnmraw pnm pnmraw ppm ppmraw
pkm pkmraw tiffcrle tiffg3 tiffg32d tiffg4 tifflzw tiffpack tiff12nc
tiff24nc psmono psgray psrgb bit bitrgb bitcmyk pngmono pnggray png16
png256 png16m jpeg jpeggray pdfwrite bbox pswrite epswrite pxlmono
pxlcolor nullpage
Search path:
. : /usr/share/ghostscript/5.50 : /usr/share/fonts/default/ghostscript :
/usr/share/fonts/default/Type1
For more information, see /usr/share/ghostscript/5.50/doc/Use.htm.
Report bugs to ghost@aladdin.com, using the form in Bug-form.htm.
- In order to use PrintTool with GS/HPIJS you must append the printerdb_append file with /usr/lib/rhs/rhs-printfilters/printerdb.
This will allow you to select the HP printers supported by GS/HPIJS. You can use the following shell script for Redhat 6.2 and
Redhat 7.0.
# sh append_db.sh
You should now have the GS/HPIJS built and ready to run as the default gs command.
See Installation on how to install a print spooler.
For different Linux distributions you will have to modify
the unix-gcc.mak file that comes with the HP InkJet Server distribution.
The following changes were made to unix-gcc.mak for Redhat 6.2 and Redhat 7.0.
Other distributions will have different defines.
prefix = /usr
GS_LIB_DEFAULT=$(gsdatadir):$(datadir)/fonts/default/ghostscript:$(datadir)/fonts/default/Type1
XLIBDIRS=-L/usr/X11R6/lib
6 Installation
The following installation instructions are for Redhat 6.2 and Redhat 7.0.
In order to install a print spooler for GS/HPIJS you must be logged in
as root. Then start the printtool program.
You should see the following PrintTool window.
PrintTool already has two print spools installed - lp8 and lp. These spoolers are
based on reversed engineered HP printer drivers. We are going to add our own HP printer
driver.
Click on the Add button.
Click OK to install a local printer.
This window shows the local device /dev/lp0 was detected - click OK.
The name of our spooler will be lp0 - click Select.
This window displays all printer devices supported by PrintTool. We will select the HP - developed DeskJet 900C series - click OK, OK.
Use the lpd menu to restart the lpd daemon so
that the spool entry will be recognized. We are now done - exit PrintTool.
7 Usage
7.1 Spooler Example
The user can use the new spooler created in our installation example above by specifying lp0 as the print spool. The following command
will print a postscript file to the lp0 spooler.
$ lpr -Plp0 tiger.ps
Most Linux applications use the lpr command to print documents. If you do not specify which
spooler to print to, the lpr command will default to the first spooler entry in PrintTool.
In our installation example above this would be lp8. The following command would default to lp8.
$ lpr tiger.ps
Make lp0 the first entry in PrintTool if you want it to be the default spooler.
7.2 Ghostscript Example
Here is a gs example using our driver on a 990C deskjet from the command line.
This command bye passes the spooler and prints directly to the printer.
You must be logged in as root in order direct the output directly to /dev/lp0.
gs -sDEVICE=DJ9xxVIP -r300x300 -dPrintMode=1 -dNOPAUSE -dSAFER -sOutputFile="/dev/lp0" file.ps -c quit
David Suffield
© 2001 Hewlett-Packard Company
Last updated Feb 7, 2001