|
|
|
<papowell@astart.com>
AStArt Technologies addr
6741 Convoy Court,
San Diego, CA 92111
Phone 858-874-6543
Fax 858-751-2435
Copyright © 2002 Patrick Powell
The ifhp program is an enhanced, extended, highly configurable, and portable implementation of a print filter for use with the LPRng Print spooler package. ifhp supports network, serial, and parallel printers, does page accounting and job recovery, and allows an extremely high level of configuration and tuning. ifhp gets its flexibility by using a configuration file to set its operational characteristics. The configuration file can contain multiple separate printer configurations and the configuration selection is done by a very simple command line option. The filter supports text, PostScript, PCL, and PJL printers, and can be configured to handle a wide range of printer quirks and mis-implementations.
Important: THIS DOCUMENTATION AND THE DESCRIBED SOFTWARE IS PROVIDED BY THE AUTHORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS DOCUMENTATION, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
The ifhp Print Filter is the primary print filter for the LPRng Print Spooler. This document is designed to be the single basic reference for the ifhp software; the LPRng software is distributed separately and has additional documentation.
I would like to thank all of the LPRng users who so relentlessly tried the incredible number of permutations and combinations of printers and software, and whose requests for just one more feature led to the development of the software.
The following table shows the default system prompt and superuser prompt. The examples will use this prompt to indicate which user you should be running the example as.
The following table describes the typographic conventions used in this book.
| Meaning | Examples |
|---|---|
| The name of commands, files, and directories. On screen computer output. |
Edit your .login file. Use ls -a to list all files.
You have mail.
|
| What you type, when contrasted with on-screen computer output. |
% su
Password:
|
| Manual page references. | Use su(1) to change user names. |
| User and group names | Only root can do this. |
| Emphasis | You must do this. |
| Command line variables; replace with the real name or variable. | To delete a file, type rm filename |
| Environment variables | $HOME is your home directory. |
Within the text appear notes, warnings, and examples.
Note: Notes are represented like this, and contain information that you should take note of, as it may affect what you do.
WarningWarnings are represented like this, and contain information warning you about possible damage if you do not follow the instructions. This damage may be physical, to your hardware or to you, or it may be non-physical, such as the inadvertant deletion of important files.
The ifhp print filter is the latest in a long evolutionary path of print filters for the LPRng print spooler system. It unifies the low level printer communication facilities and provide a common code base for future development.
This document is the complete set of references and installation guide for the ifhp print filter. It covers compilation, installation, initial testing, details of system configuration, and configuration options that would be needed by the system administrator. Previous releases of ifhp had a large selection of README files which are now incorporated into the IFHP Reference Manual.
Information about LPRng and ifhp can be found on the LPRng web page http://www.lprng.com.
There is mailing list for ifhp and LPRng at <lprng@lprng.com>. In
order to reduce the amount of unsolicited spam mail posted
to the list you must subscribe to the list before posting
to it. To subscribe, send email message to lprng-request@lprng.com, with the
single word subscribe in the body.
Several presentations of LPRng and print spooling software have been made at the Large Scale Installation Administrator (LISA) conferences and are in the ifhp distribution and available on web sites. The slides for the LISA 97 tutorial on Printers and Network Print Spooling are the LISA97.ppt in the LPRng distribution.
During development of ifhp, the following documents were invaluable references. For Printer Job Language (PJL) related issues see the Printer Job Language Technical Reference Manual, Hewlett Packard, 10th Edition, October 1997. For PCL related issues see the PCL 5 Printer Language Technical Reference Manual, First Edition, 1992. These manuals are available through the Hewlett Packard Developers Program. See http://www.hp.com/go/devexchange for information on how to join.
Material included in this document from the ifhp distribution Copyright Patrick Powell 1988-1999, where applicable. The rights to distribute this document complete or in part are hereby granted for non-commercial purposes. Partial reproductions must acknowledge the source. Permission to distribute this file together with LPRng, ifhp and `derived works' is explicitly granted.
THE MATERIAL IN THIS DOCUMENT IS PROVIDED WITHOUT FEE AND AS-IS WITH NO WARRANTY REGARDING FITNESS OF USE FOR ANY PURPOSE. THE AUTHOR AND ALL CONTRIBUTORS ARE NOT LIABLE FOR ANY DAMAGES, DIRECT OR INDIRECT, RESULTING FROM THE USE OF INFORMATION PROVIDED IN THIS DOCUMENT.
AStArt Technologies (http://www.astart.com) provides commercial support and enhancements for LPRng, ifhp, and other network software. AStArt provides network and system consulting services for UNIX and NT systems, as well as real time and network software.
Main FTP Site:
| ftp://ftp.lprng.com/pub/LPRng (US) |
Mirrors:
To join the LPRng mailing list, please send mail to lprng-request@lprng.ie with the only the word subscribe in the body of the message.
The LPRng and ifhp distributions have MD5 checksum files which are signed with a PGP public key. Here is the key for validating the checksums:
Type Bits/KeyID Date User ID
pub 1024/00D95C9D 1997/01/31 Patrick A. Powell <papowell@astart.com>
Patrick A. Powell <papowell@sdsu.edu>
-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: 2.6.3i
mQCNAzLygTQAAAEEANBW5fPYjN3wSAnP9xWOUc3CvsMUxjip0cN2sY5qrdoJyIhn
qbAspBopR+tGQfyp5T7C21yfWRRnfXmoJ3FVtgToAsJUYmzoSFY08eDx+rmSqCLe
rdJjX8aG8jVXpGipEo9U4QsUK+OKzx3/y/OaK4cizoWqKvy1l4lEzDsA2VydAAUT
tCdQYXRyaWNrIEEuIFBvd2VsbCA8cGFwb3dlbGxAYXN0YXJ0LmNvbT6JAJUDBRA0
XonoiUTMOwDZXJ0BAQ2cBAC7zU9Fn3sC3x0USJ+3vjhg/qA+Gjb5Fi1dJd4solc4
vJvtf0UL/1/rGipbR+A0XHpHzJUMP9ZfJzKZjaK/d0ZBNlS3i+JnypypeQiAqo9t
FV0OyUCwDfWybgAORuAa2V6UJnAhvj/7TpxMmCApolaIb4yFyKunHa8aBxN+17Ro
rrQlUGF0cmljayBBLiBQb3dlbGwgPHBhcG93ZWxsQHNkc3UuZWR1PokAlQMFEDLy
gTSJRMw7ANlcnQEBYBYD/0zTeoiDNnI+NjaIei6+6z6oakqO70qFVx0FG3aP3kRH
WlDhdtFaAuaMRh+RItHfFfcHhw5K7jiJdgKiTgGfj5Vt3OdHYkeeh/sddqgf9YnS
tpj0u5NfrotPTUw39n6YTgS5/aW0PQfO9dx7jVUcGeod1TGXTe9mIhDMwDJI4J14
=3Zbp
-----END PGP PUBLIC KEY BLOCK-----
Before you do an installation please read the following instructions. You will need to:
Use GNU Make. You can get it from http://www.gnu.org/software/software.html. Don't even think about trying to use another make unless you are a Wizard. And even the Wizards use GNU Make.
Use an ANSI C compiler. ifhp is developed and tested with the GNU C compiler. You can get it from http://www.gnu.org/software/software.html. Solaris users should consult the excellent http://sunfreeware.com site for binary distributions. AIX users can use http://www.bull.de/pub/ or ftp://ftp.htwk-leipzig.de
The following software is recommended for use with ifhp. If your printer does not support PostScript, PCL, or text printing directly you will need to install GhostScript to convert from PostScript to the printer format and use a suitable text to PostScript converter.
The ifhp filter will recognize that a file is PostScript, PJL, or PCL by examining the first couple of bytes of a file and applying a simple set of rules. If you require more elaborate file type detection then you can configure ifhp to also use the UNIX file utility if it is unable to determine the file type. See ftp://ftp.astron.com/pub/file/ or ftp://ftp.lprng.com/pub/LPRng/UNIXTOOLS/file/ to obtain this software.
http://www.lprng.com The ifhp filter works best with the later versions of this software, and the two are developed as an integrated unit.
http://www.cs.wisc.edu/~ghost/index.html or http://www.ghostscript.com If your printer does not handle PostScript and you need to print PostScript, GhostScript is used to convert PostScript to a format usable by the printer.
If your printer is a PostScript only printer or you wish to have enhanced formatting capability for documents, then you will need a text to PostScript converter. http://www-inf.enst.fr/~demaille/a2ps/ This package does a very good job of text to PostScript conversion. It also makes use of the file utility to determine the required conversions.
http://www.gnu.org/ This package is an alternative to a2ps, but requires careful handling due to the exit codes it produces. Please see Wrappers For Programs for details on how to use enscript with ifhp.
This program is included with the ifhp distribution and is an extremely primitive text to PostScript filter. It generates PostScript compatible with even the most ancient of PostScript printers and is useful where a2ps and enscript are just too modern. See http://www.lprng.com.
The psutils package developed by Angus Duggan is available from ftp://ftp.dcs.ed.ac.uk/pub/ajcd/. These are a collection of programs for manipulation of PostScript files, and include facilities for doing page selection, page reversal, n-up printing, and watermarking.
The netcat utility is extremely useful
when trying to send files to a network printer and
you need to monitor its activity. Developed by
<hobbit@avian.org>,
it is available from ftp://avian.org/src/hacks/nc110.tgz.
The installation procedure uses the configure facility to generate Makefiles. By convention, these files have the following variables that install the ifhp executables and configuration files in the following locations:
Table 2-1. Configure File Location Variables
| Configure Variable | Default Value | Expanded Default Value | Override |
|---|---|---|---|
| ${prefix} | /usr/local | --prefix=PATH | |
| ${exec_prefix} | ${prefix} | /usr/local | --execprefix=PATH |
| ${bindir} | ${exec_prefix}/bin | /usr/local/bin | --bindir=PATH |
| ${sbindir} | ${exec_prefix}/sbin | /usr/local/sbin | --sbindir=PATH |
| ${libexecdir} | ${exec_prefix}/libexec | /usr/local/libexec | --libexecdir=PATH |
| ${sysconfdir} | ${prefix}/etc | /usr/local/etc | --sysconfdir=PATH |
| ${mandir} | ${prefix}/man | /usr/local/man | --mandir=PATH |
The following files are installed as shown below:
Table 2-2. Executable and Configuration File Locations
| Configure Variable | Files |
|---|---|
| ${libexecdir}/filters | lpf, ifhp |
| ${sysconfdir} | ifhp.conf |
| ${mandir}/man[1-9] | man pages |
The configuration you choose should match that of the LPRng print spooler. For example:
./configure --prefix=/usr --sysconfdir=/etc \
--mandir=/usr/share/man
executables and files in
/usr/libexec/filters ifhp
/etc ifhp.conf
/usr/share/man/man[0-9] ifhp.man1
First, we untar, configure, compile, and install the software:
h4: {1} % gunzip -c ifhp-<version>.tgz | tar xvf -
h4: {2} % cd ifhp-<version>
h4: {3} % ./configure [ ... configuration options ]
h4: {4} % make clean all
h4: {5} % su # you must do the following commands as root
h4: {6} # make install
Modify your printcap file to use ifhp. Your printcap usually has the following format; older version of lpd require :\ at the end of each line of a printcap entry. The :if and :of filter entries are usually the ones of interest.
lp:
:lp=xxxx:sd=xxxx:....
:if=/usr/local/path_to_old_filters/old_if_filter
:of=/usr/local/path_to_old_filters/old_of_filter
Your new printcap entry will look like the one below. The MODEL information is described in the next section.
lp:
:lp=xxxx:sd=xxxx:....
# see text for details about the next line
:ifhp=model=MODEL,status@
:filter=/usr/local/libexec/filters/ifhp
# only if you are using accounting or banners
#:of=/usr/local/libexec/filters/ifhp
Select a suitable printer from the entries in the configuration file (/usr/local/etc/lpd.conf or /etc/lpd.conf). These are described in more detail in the next section.
Shut down and restart your print spooler and then send a job to the printer. If this works and you do not need any further capabilities of ifhp such as error reporting or printer monitoring, then you are finished.
If you want to use additional capabilities, then you should read the detailed instructions in the next couple of sections.
There are over 500 different printer models, types and configurations supported by ifhp. If your printer is not currently supported and you have documentation about the printer then send mail to the LPRng Mailing List and support will be added.
The default printer is an HP LaserJet 4MP, which supports PostScript Level 3, PCL5, PJL, and has bidirectional communication and a functional pagecounter.
The ifhp.conf configuration file contains configuration entries for various models of printers. Each entry has a name usually corresponding to the model of printer or its basic capabilities. For example, the HP LaserJet 4 printer has the model=hp4 configuration entry. The default printer configuration covers a wide range of network printers manufactured by Hewlett-Packard, Canon, Epson, and others and is for a printer that has a bidirectional communications connection that allows it to report status information and the following capabilities:
PJL support (pjl) compatible with HP 4 family of printers
PostScript (PS) support (ps).
PCL support (pcl).
Text files printed as PCL (text, default_language=pcl).
There is also support for PostScript only printers (model=ps), Tektronics Phasers (model=phaser), QMS (model=qmsXXX) and others. The best way to determine the printers currently supported is to examine the ifhp.conf file. The following is a sample of the various entries in the configuration file.
Table 2-3. ifhp.conf Configuration Entries
| Configuration | Printer Supported |
|---|---|
| default | Generic Printer based on HP 4M Plus, PostScript, PJL, HPGL2, PCL, status, pagecount support |
| apple | Generic PostScript printer, text to PS conversion, status, pagecount support |
| postscript | Generic PostScript printer, text to PS conversion, status, pagecount support |
| ps | Generic PostScript printer, text to PS conversion, status, pagecount support |
| pcl | Generic PCL only printer, no status |
| pcl_gs | HP LaserJet 4 PCL only printer, write only, no status |
| hpiiisi | HP LaserJet III (PCL and PostScript Interpreter) |
| hp3si | HP LaserJet III (PCL and PostScript Interpreter) |
| ljet3 | HP LaserJet III (PCL and PostScript Interpreter) |
| lj3 | HP LaserJet III (PCL and PostScript Interpreter) |
| hpiiisi.gs | HP LaserJet III (PCL, PostScript via GhostScript) |
| hp3si.gs | HP LaserJet III (PCL, PostScript via GhostScript) |
| ljet3.gs | HP LaserJet III (PCL, PostScript via GhostScript) |
| lj3.gs | HP LaserJet III (PCL, PostScript via GhostScript) |
| hp4 | HP LaserJet 4 Family, HP LaserJet 4 (PostScript Interpreter) |
| hp4m | HP LaserJet 4 Family, HP LaserJet 4m (PostScript Interpreter) |
| hp4si | HP LaserJet 4 Family, HP LaserJet 4si (PostScript Interpreter) |
| hp4simx | HP LaserJet 4 Family, HP LaserJet 4simx (PostScript Interpreter) |
| hp4plus | HP LaserJet 4 Family, HP LaserJet 4plus (PostScript Interpreter) |
| hp4mplus | HP LaserJet 4 Family, HP LaserJet 4mplus (PostScript Interpreter) |
| hp4v | HP LaserJet 4 Family, HP LaserJet 4v (PostScript Interpreter) |
| hp4mv | HP LaserJet 4 Family, HP LaserJet 4mv (PostScript Interpreter) |
| hp4p | HP LaserJet 4 Family, HP LaserJet 4p (PostScript Interpreter) |
| hp4mp | HP LaserJet 4 Family, HP LaserJet 4mp (PostScript Interpreter) |
| hp4pj | HP LaserJet 4 Family, HP LaserJet 4pj (PostScript Interpreter) |
| hpljpro | HP LaserJet 4 Family, HP LaserJet ljpro (PostScript Interpreter) |
| hp4lc | HP LaserJet 4 Family, HP LaserJet 4lc (PostScript Interpreter) |
| hp4mplus | HP LaserJet 4MPlus |
| hp5l | HP LaserJet 5 Family, Hp LaserJet 5l |
| hp6l | HP LaserJet 6 Family, Hp LaserJet 6l |
| hp1100 | HP LaserJet 6 Family, Hp LaserJet 1100 |
| hp1100 | HP LaserJet 1000 Family, Hp LaserJet 1100 |
| hp4l | Hp LaserJet 4L, PCL only |
| hp4ml | HP LaserJet 4ml |
| hp5p | HP LaserJet 5p |
| hp5mp | HP LaserJet 5mp |
| hp6p | HP LaserJet 6p |
| hp6mp | HP LaserJet 6mp |
| hp5 | HP LaserJet 5 |
| hp5si | HP LaserJet 5si |
| hp5simx | HP LaserJet 5simx |
| hp5m | HP LaserJet 5m |
| hp4100 | HP LaserJet 4100 |
| hp4200 | HP LaserJet 4200 |
| hp4300 | HP LaserJet 4300 |
| hp5simopier | HP LaserJet 5simopier |
| hp4000 | HP LaserJet 4000 |
| hpcolorlj | HP Color LaserJet |
| hpcolorlj5 | HP Color LaserJet 5 |
| hpcolorlj5m | HP Color LaserJet 5m |
| hpdj1200 | HP DesignJet 1200 Family |
| hppjxl300 | HP PaintJet XL 300 Family |
| hpdj1600 | HP DesignJet 1600 Family |
| hpdj200 | HP DeskJet 200 |
| hpdj220 | HP DeskJet 220 |
| hpdj600 | HP DeskJet 600 |
| hpdj650 | HP DeskJet 650 |
| hpdj230 | HP DeskJet 230 |
| hpdj250c | HP DeskJet 250c |
| hpdj330 | HP DeskJet 330 |
| hpdj350c | HP DeskJet 350c |
| hpdj430 | HP DeskJet 430 |
| hpdj450c | HP DeskJet 450c |
| hpdj455ca | HP DeskJet 455ca |
| hpdj700 | HP DeskJet 700 |
| hpdj750c | HP DeskJet 750c |
| hpdj750cplus | HP DeskJet 750cplus |
| hpdj755cm | HP DeskJet 755cm |
| hpdj2000cp | HP DeskJet 2000cp |
| hp2500 | HP DesignJet 2500 - No PCL, PostScript Only |
| hp2500cm | HP DesignJet 2500cm - No PCL, PostScript Only |
| hp2500c | HP DesignJet 2500c - No PCL, PostScript Only |
| hp2500cm | HP DesignJet 2500cm - PCL and PostScript |
| hpdj2500cp | HP DesignJet 2500CP, not HP2500, HP2500c, HP2500cm |
| hp4500 | HP Color LaserJet Printer 4500 |
| hp8500 | HP Color LaserJet Printer 8500 |
| hp8550 | HP Color LaserJet Printer 8550 |
| hp4550n | HP 4550N |
| hp5000 | HP 5000 Model C4111A (LaserJet 5000) |
| hp8000 | HP LaserJet 8000 Series, HP8000 |
| hp8100 | HP LaserJet 8000 Series, HP8100 |
| hp8150 | HP LaserJet 8000 Series, HP8150 |
| hp2100 | HP LaserJet 2100 Series |
| hp2200 | HP LaserJet 2200 Series |
| hp4050 | HP 4050 Series Printers |
| qms1725 | QMS 1725, uses appsocket, no status, PostScript only |
| qms2025 | QMS Laser Printer QMS 2025, appsocket, no status, PostScript and PCL |
| qms860 | QMS Laser Printer QMS 860, appsocket, no status, PostScript and PCL |
| qms2060 | QMS Laser Printer QMS 2060, appsocket, no status, PostScript and PCL |
| phaser | Tektronics Generic Phaser Color Printer, appsocket, snmp monitoring, PostScript only |
| phaser360 | Tektronics Phaser 360 Color Printer, appsocket, snmp monitoring, PostScript only |
| phaser740 | Tektronics Phaser 740 Color Printer, appsocket, snmp monitoring, PostScript only |
| phaser750 | Tektronics Phaser 750 Color Printer, appsocket, snmp monitoring, PostScript only |
| phaser850 | Tektronics Phaser 850 Color Printer, appsocket, snmp monitoring, PostScript only |
| phaser740 | Tektronics Phaser 740 Color Printer, appsocket, snmp monitoring, PostScript and PCL |
| phaser5400 | Tektronics Phaser 5400 Color Printer, appsocket, snmp monitoring, PostScript and PCL |
| phaser7700 | Tektronics Phaser 7700 Color Printer, appsocket, snmp monitoring, PostScript and PCL |
| lexmark4039 | Lexmark 4039, Postscript only |
| lexmark_optra_e312 | Lexmark Optra e312, Postscript, PCL and PJL |
| ln15s | Digital Laser LN15, LN17ps, Compaq Laser LN 16 |
| ln16s | Digital Laser LN15, LN17ps, Compaq Laser LN 16 |
| ln17pss | Digital Laser LN15, LN17ps, Compaq Laser LN 16 |
| hpij2250s | HP Business Inkjet 2250 |
| gs_bj10 | Canon BubbleJet BJ10e |
| gs_bj10 | Canon BubbleJet BJ20 |
| gs_bj200 | Canon BubbleJet BJ200 |
| gs_bj200 | Canon BubbleJet BJC-210 B/W only |
| gs_bj200 | Canon BubbleJet BJC-240 B/W only |
| gs_bj200 | Canon BubbleJet BJC-250 B/W only |
| gs_bj200 | Canon BubbleJet BJC-70 B/W only |
| gs_bjc600 | Canon BubbleJet BJC-600 |
| gs_bjc600 | Canon BubbleJet BJC-610 |
| gs_bjc600 | Canon BubbleJet BJC-50 |
| gs_bjc600 | Canon BubbleJet BJC-70 |
| gs_bjc600 | Canon BubbleJet BJC-80 |
| gs_bjc600 | Canon BubbleJet BJC-210 Color only |
| gs_bjc600 | Canon BubbleJet BJC-240 Color only |
| gs_bjc600 | Canon BubbleJet BJC-250 |
| gs_bjc600 | Canon BubbleJet BJC-1000 |
| gs_bjc600 | Canon BubbleJet BJC-2000 |
| gs_bjc600 | Canon BubbleJet BJC-4000 |
| gs_bjc600 | Canon BubbleJet BJC-4100 B/W only |
| gs_bjc600 | Canon BubbleJet BJC-4200 |
| gs_bjc600 | Canon BubbleJet BJC-4300 |
| gs_bjc600 | Canon BubbleJet BJC-4550 |
| gs_bjc600 | Canon BubbleJet BJC-6000 |
| gs_bjc600 | Canon MultiPASS C2500 color printer/fax/copier |
| gs_bjc800 | Canon BubbleJet BJC-800 |
| gs_bjc800 | Canon BubbleJet BJC-7000 Color. |
| gs_bjc800 | Canon BubbleJet BJC-4300 Color |
| gs_bjc800 | Canon BubbleJet BJC-4650 |
| gs_deskjet | HP DeskJet |
| gs_deskjet | HP DeskJet Plus |
| gs_djet500 | HP DeskJet 500 B/W |
| gs_djet500 | HP DeskJet Portable B/W |
| gs_djet500 | HP OfficeJet 590 B/W |
| gs_cdj500 | HP DeskJet 400 |
| gs_cdj500 | HP DeskJet 500C |
| gs_cdj500 | HP DeskJet 540C |
| gs_cdj500 | HP DeskJet 690C |
| gs_cdj500 | HP DeskJet 693C |
| gs_cdj550 | HP DeskJet 550C |
| gs_cdj550 | HP DeskJet 560C |
| gs_cdj550 | HP DeskJet 600 |
| gs_cdj550 | HP DeskJet 660C |
| gs_cdj550 | HP DeskJet 660C |
| gs_cdj550 | HP DeskJet 682C |
| gs_cdj550 | HP DeskJet 683C |
| gs_cdj550 | HP DeskJet 693C |
| gs_cdj550 | HP DeskJet 694C |
| gs_cdj550 | HP DeskJet 690C |
| gs_cdj550 | HP DeskJet 692C |
| gs_cdj550 | HP DeskJet 693C |
| gs_cdj550 | HP DeskJet 694C |
| gs_cdj550 | HP DeskJet 695C |
| gs_cdj550 | HP DeskJet 850 |
| gs_cdj550 | HP DeskJet 870Cse |
| gs_cdj550 | HP DeskJet 895Cxi |
| gs_cdj550 | HP DeskJet 970 |
| gs_cdj550 | HP OfficeJet 590 |
| gs_cdj550 | Olivetti jp450 |
| gs_cdj550 | Xerox XJ6C, PCL and Postscript using GhostScript |
| gs_cdj850 | HP DeskJet 850 |
| gs_cdj850 | HP DeskJet 855 |
| gs_cdj850 | HP DeskJet 870Cse |
| gs_cdj850 | HP DeskJet 870Cxi |
| gs_cdj850 | HP DeskJet 890C |
| gs_cdj850 | HP DeskJet 670C |
| gs_cdj850 | HP DeskJet 680 |
| gs_cdeskjet | HP DeskJet 500C |
| gs_cdjmono | HP DeskJet 500C |
| gs_cdjmono | HP DeskJet 510 |
| gs_cdjmono | HP DeskJet 520 |
| gs_cdjmono | HP DeskJet 540C |
| gs_cdjmono | HP DeskJet 693C |
| gs_epsonc | Fujitsu DL-1100 |
| gs_epsonc | Fujitsu DL-2400 |
| gs_hl7x0 | Brother HL-720 |
| gs_hl7x0 | Brother HL-730 |
| gs_laserjet | Bull Compuprint Pagemaster 415 |
| gs_lips3 | Canon LBP4+ |
| gs_lj4dith | HP DeskJet 600 |
| gs_ljet2 | HP LaserJet II |
| gs_ljet2 | Xerox 4030 - PCL, PostScript support using GhostScript |
| gs_ljet3 | Tandy LP800 With LaserJet III emulation. |
| gs_ljet4 | Brother HL-660 |
| gs_ljet4 | Brother HL-760 600dpi |
| gs_ljet4 | Epson EPL5700 300dpi OK |
| gs_ljet4 | HP DeskJet 600 margins wrong |
| gs_ljet4 | HP DeskJet 870Cse |
| gs_ljet4 | HP LaserJet 5 300dpi or 600dpi |
| gs_ljet4 | HP LaserJet 5L 300dpi or 600dpi |
| gs_ljet4 | HP LaserJet 6L 600dpi |
| gs_ljet4 | HP LaserJet 1100 600dpi OK. |
| gs_ljet4 | IBM Network Printer 17 |
| gs_ljet4 | IBM/Lexmark 4029 Margins wrong. |
| gs_ljet4 | Lexmark Optra E+ |
| gs_ljet4 | Lexmark Optra SC 1275 B/W only. |
| gs_ljet4 | Oki OL410ex LED printer 300dpi or 600dpi |
| gs_ljetplus | HP LaserJet Plus |
| gs_ljetplus | Canon Laser LBP-600 |
| gs_ljetplus | NEC SuperScript 860 |
| gs_pjxl300 | HP PaintJet XL300 |
| gs_pjxl300 | HP DeskJet 600 |
| gs_pjxl300 | HP DeskJet 1200C |
| gs_pjxl300 | HP DeskJet 1600C |
| gs_r4081 | Ricoh 4081 laser printer |
| gs_r4081 | Ricoh 6000 laser printer |
| bjc610a0.upp | Canon BubbleJet BJC-610 (color, rendered) 360x360dpi plain paper, high speed |
| bjc610a1.upp | Canon BubbleJet BJC-610 (color, rendered) 360x360dpi plain paper |
| bjc610a2.upp | Canon BubbleJet BJC-610 (color, rendered) 360x360dpi coated paper |
| bjc610a3.upp | Canon BubbleJet BJC-610 (color, rendered) 360x360dpi transparency film |
| bjc610a4.upp | Canon BubbleJet BJC-610 (color, rendered) 360x360dpi back print film |
| bjc610a5.upp | Canon BubbleJet BJC-610 (color, rendered) 360x360dpi fabric sheet |
| bjc610a6.upp | Canon BubbleJet BJC-610 (color, rendered) 360x360dpi glossy paper |
| bjc610a7.upp | Canon BubbleJet BJC-610 (color, rendered) 360x360dpi high gloss film |
| bjc610a8.upp | Canon BubbleJet BJC-610 (color, rendered) 360x360dpi high resolution paper |
| bjc610b1.upp | Canon BubbleJet BJC-610 (color, rendered) 720x720dpi plain paper |
| bjc610b2.upp | Canon BubbleJet BJC-610 (color, rendered) 720x720dpi coated paper |
| bjc610b3.upp | Canon BubbleJet BJC-610 (color, rendered) 720x720dpi transparency film |
| bjc610b4.upp | Canon BubbleJet BJC-610 (color, rendered) 720x720dpi back print film |
| bjc610b6.upp | Canon BubbleJet BJC-610 (color, rendered) 720x720dpi glossy paper |
| bjc610b7.upp | Canon BubbleJet BJC-610 (color, rendered) 720x720dpi high-gloss paper |
| bjc610b8.upp | Canon BubbleJet BJC-610 (color, rendered) 720x720dpi high resolution paper |
| cdj550.upp | HP DeskJet 550C 300x300dpi 32-bit CMYK |
| necp2x.upp | NEC P2X 360x360dpi 8-bit (Floyd-Steinberg) |
| stcany.upp | Epson Stylus Color (Any) 360x360dpi 4-bit, PostScript halftoning |
| stc.upp | Epson Stylus (Original) and Stylus Pro Color 360x360dpi 32-bit CMYK, 15-pin |
| stc_l.upp | Epson Stylus (Original) and Stylus Pro Color 360x360dpi 4-bit, PostScript halftoning, weaved noWeave |
| stc_h.upp | Epson Stylus (Original) and Stylus Pro Color 720x720dpi 32-bit CMYK, 15-pin Weave |
| stc2.upp | Epson Stylus (Original) and Stylus Pro Color 360x360dpi 32-bit CMYK, 20-pin, Epson Stylus Color II(s) |
| stc2_h.upp | Epson Stylus (Original) and Stylus Pro Color 720x720dpi 32-bit CMYK, 20-pin, Epson Stylus Color II |
| stc2s_h.upp | Epson Stylus (Original) and Stylus Pro Color 720x720dpi 32-bit CMYK, 20-pin, Epson Stylus Color IIs |
| stc500p.upp | Epson Stylus Color 500 360x360dpi 32-bit CMYK, noWeave, plain paper |
| stc500ph.upp | Epson Stylus Color 500 720x720dpi 32-bit CMYK, noWeave, plain paper |
| stc600pl.upp | Epson Stylus Color 600, 360x360dpi, 32/90-inch weaving 32-bit CMYK, 32-pin, plain paper |
| stc600p.upp | Epson Stylus Color 600, 720x720dpi, 32/90-inch weaving 32-bit CMYK, 32-pin, plain paper |
| stc600ih.upp | Epson Stylus Color 600, 1440x720dpi, 32/90-inch weaving 32-bit CMYK, 30-pin, inkjet paper |
| stc800pl.upp | Epson Stylus Color 800, 64/180-inch weaving 360x360dpi 32-bit CMYK, 64-pin, plain paper |
| stc800p.upp | Epson Stylus Color 800, 64/180-inch weaving 720x720dpi 32-bit CMYK, 64-pin, plain paper |
| stc800ih.upp | Epson Stylus Color 800, 64/180-inch weaving 1440x720dpi 32-bit CMYK, 62-pin, inkjet paper |
| stc1520h.upp | Epson Stylus Color 800, 64/180-inch weaving 1440x720dpi 32-bit CMYK, 62-pin, inkjet paper |
| imagerunner550 | Canon imageRUNNER 550/600 iR600-550-60 |
| imagerunner600 | Canon imageRUNNER 550/600 iR600-550-60 |
| hpdj800ps | HP DesignJet 800ps |
| panther | Sharp Generic Panther Family, PS and PCL, uses SNMP for status and pagecount |
| ar-160 | Sharp %, Panther Family, PS and PCL, uses SNMP for status and pagecount |
| ar-161 | Sharp %, Panther Family, PS and PCL, uses SNMP for status and pagecount |
| ar-162 | Sharp %, Panther Family, PS and PCL, uses SNMP for status and pagecount |
| ar-162s | Sharp %, Panther Family, PS and PCL, uses SNMP for status and pagecount |
| ar-163 | Sharp %, Panther Family, PS and PCL, uses SNMP for status and pagecount |
| ar-164 | Sharp %, Panther Family, PS and PCL, uses SNMP for status and pagecount |
| ar-200 | Sharp %, Panther Family, PS and PCL, uses SNMP for status and pagecount |
| ar-200s | Sharp %, Panther Family, PS and PCL, uses SNMP for status and pagecount |
| ar-201 | Sharp %, Panther Family, PS and PCL, uses SNMP for status and pagecount |
| ar-205 | Sharp %, Panther Family, PS and PCL, uses SNMP for status and pagecount |
| ar-206 | Sharp %, Panther Family, PS and PCL, uses SNMP for status and pagecount |
| ar-207 | Sharp %, Panther Family, PS and PCL, uses SNMP for status and pagecount |
| ar-f201 | Sharp %, Panther Family, PS and PCL, uses SNMP for status and pagecount |
| cougar | Sharp Generic Cougar Family, PS and PCL, uses SNMP for status and pagecount |
| ar-335 | Sharp %, Cougar Family, PS and PCL, uses SNMP for status and pagecount |
| ar-336 | Sharp %, Cougar Family, PS and PCL, uses SNMP for status and pagecount |
| ar-337 | Sharp %, Cougar Family, PS and PCL, uses SNMP for status and pagecount |
| ar-s337 | Sharp %, Cougar Family, PS and PCL, uses SNMP for status and pagecount |
| ar-405 | Sharp %, Cougar Family, PS and PCL, uses SNMP for status and pagecount |
| ar-407 | Sharp %, Cougar Family, PS and PCL, uses SNMP for status and pagecount |
| ar-505 | Sharp %, Cougar Family, PS and PCL, uses SNMP for status and pagecount |
| ar-s505 | Sharp %, Cougar Family, PS and PCL, uses SNMP for status and pagecount |
| ar-507 | Sharp %, Cougar Family, PS and PCL, uses SNMP for status and pagecount |
| ar-s507 | Sharp %, Cougar Family, PS and PCL, uses SNMP for status and pagecount |
| ar-250 | Sharp %, Cougar Family, PS and PCL, uses SNMP for status and pagecount |
| ar-280 | Sharp %, Cougar Family, PS and PCL, uses SNMP for status and pagecount |
| ar-281 | Sharp %, Cougar Family, PS and PCL, uses SNMP for status and pagecount |
| ar-285 | Sharp %, Cougar Family, PS and PCL, uses SNMP for status and pagecount |
| ar-286 | Sharp %, Cougar Family, PS and PCL, uses SNMP for status and pagecount |
| leopard | Sharp Generic Leopard Family, PS and PCL, uses SNMP for status and pagecount |
| ar-235 | Sharp %s, Leopard Family, PS and PCL, uses SNMP for status and pagecount |
| ar-275 | Sharp %s, Leopard Family, PS and PCL, uses SNMP for status and pagecount |
| ar-n275 | Sharp %s, Leopard Family, PS and PCL, uses SNMP for status and pagecount |
| ar-m208 | Sharp %s, Leopard Family, PS and PCL, uses SNMP for status and pagecount |
| tiger | Sharp Generic Tiger Family, PS and PCL, uses SNMP for status and pagecount |
| ar-p350 | Sharp %, Tiger Family, PS and PCL, uses SNMP for status and pagecount |
| ar-m350 | Sharp %, Tiger Family, PS and PCL, uses SNMP for status and pagecount |
| ar-m350u | Sharp %, Tiger Family, PS and PCL, uses SNMP for status and pagecount |
| ar-m350n | Sharp %, Tiger Family, PS and PCL, uses SNMP for status and pagecount |
| ar-p450 | Sharp %, Tiger Family, PS and PCL, uses SNMP for status and pagecount |
| ar-m450 | Sharp %, Tiger Family, PS and PCL, uses SNMP for status and pagecount |
| ar-m450u | Sharp %, Tiger Family, PS and PCL, uses SNMP for status and pagecount |
| ar-m450n | Sharp %, Tiger Family, PS and PCL, uses SNMP for status and pagecount |
| toshiba650 | Sharp Generic Toshiba650 Family, PS and PCL, uses SNMP for status and pagecount |
| ar-650 | Sharp %, Toshiba650 Family, PS and PCL, uses SNMP for status and pagecount |
| ar-800 | Sharp %, Toshiba650 Family, PS and PCL, uses SNMP for status and pagecount |
| fiery651 | Sharp Generic Fiery651 Family, PS and PCL, uses SNMP for status and pagecount |
| ar-651 | Sharp %, Fiery651 Family, PS and PCL, uses SNMP for status and pagecount |
| ar-810 | Sharp %, Fiery651 Family, PS and PCL, uses SNMP for status and pagecount |
If your printer is not in this this list then you can use the following guidelines. If you have a PostScript only printer you should use the ps model. If you have a PCL only printer, then pcl is recommended. If you want to process PostScript files on your PCL only printer then install GhostScript and use pcl_ps entry and select the GhostScript driver suitable for your printer.
The other model entries are used when specific printer functionality or features are needed. For example, if you want to do accounting or use landscape mode, then you should check for your specific printer model in the configuration file.
Due to the general nature of the ifhp filter, there is no standard set of -Z user options because there is no standard set of user facilities. However, the following are recommended for use by implementors of new configurations or printer support.
If a printer supports an input tray selection mechanism, then the following options are recommended for use. Local conditions or printer type may require addition options.
The input tray selection options should start with the in prefix and correspond to the various trays, if possible. The manual and envelope options are included to select manual feed or envelope feed. There is a possible source of conflict here as there may be an envelope feeder as well as an envelope media. This is a printer specific dependency.
The key=value form allows users to use options such as -Zsource=inbin1, which may be useful for systems that have an unusual or nonstandard input selection mechanism.
If a printer has an output bin selection mechanism or some other finishing mechanism, then the following are recommended for use.
The output bin selection should start with the out prefix.
The outbin=name form allow users to use options such as -Zoutbin=stapler, which may be useful for systems that have an unusual or nonstandard output selection mechanism.
The paper size selection facilities usually are quite printer dependent, and the input tray selection and paper size selection mechanisms may interact in strange and mysterious ways.
These are standard paper size names.
These are usually aliases for ledger, but depending on local conditions can select different types of paper.
The paper=name form allow users to use options such as -Zpaper=b3, which may be useful for systems that have an unusual or nonstandard input media selection mechanism.
Media Type is not the same as paper size, and corresponds to the name assigned to a particular media. Of course, the issue is complicated by the fact that some media have standard sizes as well. Again, the input tray selection, media size, and media type selection will interact in confusing and mysterious ways, depending on the whim of the printer firmware implementors.
You will also notice that there is no general mediatype=name selection mechanism. This is due to the extremely different way that the media names must be passed for PostScript, PJL, and PCL.
These are commonly used media type names gleaned from various PostScript Printer Description Files, Microsoft printer drivers, and arcane lore of the Printer Working Group. Note that these are not accepted terms in the paper industry for any of these type of media. You are warned.
Duplex printing is when impressions are placed on both sides of a sheet of media. Due to a general lack of conventions, the orientation of each of the impressions varies from vendor to vendor, and has changed over the years.
Print on both sides using the default orientation. The lduplex is an alias for duplex
Print on both sides but reverse the orientation of one page. The sduplex is an alias for duplexshort Which page is reversed is at the whim of the firmware implementors and conventions for the printer.
Print on a single side of a page
This is use to print a single page on one side of the media, but using the (nonstandard) orientation for the duplexshort. This is usually done when a single impression must be generated on the alternative side of the media, rather than the default side. Again, this is dependent on the whims and whimsies of the printer firmware implementors, and may have some unexpected side effects.
This option has been provided to effectively allow the printer to make multiple copies of a single page or job. This option tends to be misimplemented on almost all known printers, and it is strongly recommended that users do not use it. However, for completeness, compatibility, and implementor consideration, this is included, even against the better judgement of the implementors of the ifhp software.
Attempt to make nnn copies of each impression. This usually fails with catastrophic problems unless you have a system that supports all of the various options required, has enough memory to handle rasterization, you do not have a paper outage, and the printer does not stop with operator intervention. You have been warned.
One of the major difficulties with printer software is dealing with the wide range of different printer hardware configurations and printer connections. This section outlines the printer communication methods, the types of print job languages, and the effects of these on printing software and the ifhp filter.
A printer consists of a hardware print engine which marks the output page and delivers it, a set of control hardware that takes a print job in a well defined format and operates the hardware to produce output according to information in the print job, and a communication channel from the computer to the control hardware. The control hardware is sometimes called a print engine. In most modern computers the control hardware may consist of multiple microprocessors, each with their own firmware, and each performing a specific printing task. For example, one may control the paper feed path, one may do rasterization, and one may handle communications with the outside world.
In order to set up printing correctly, it is necessary to know the following information about your printer.
The capabilities of the hardware. This is dependent on the model of printer, and may be such things as the page feed, output and input tray selection, numbers of columns and/or rows of output available on the output device. This information is readily available from most manufacturers.
The print job language recognized by the control hardware. This is the special set of codes, commands, and formats recognized by the control hardware.
The protocol used to send jobs to the printer and obtain status about the printing activity.
Usually the capabilities of a modern printer are very well known and documented, and the ifhp filter and most print spooling software has little difficulty working with them.
The following checklist will help you in setting up your printer. The various options that you will need to know about are indicated where appropriate.
Printer Model (model=???) What is the exact printer model? Check the serial number or other identification to get this information. You should check the ifhp.conf configuration file to see if your printer is already supported.
Print Languages Supported By Your Printer
PJL? (pjl or pjl@) The Printer Job Language (PJL) is a high level language supported by many Hewlett-Packard printers that allows some print system configuration to be performed. Due to historical developments, not all printers support all PJL language facilities, and some support them in different ways than other printers. The ifhp filter can use the PJL support for a printer if it is available.
PostScript (and what version)? (ps or ps@) PostScript is the most common print job language in use. If your printer supports PostScript, then you will have a relatively trouble free time with it. One problem is that it requires a fairly substantial amount of memory and computational support, and is usually not found on the low end (less than $500) printers.
PCL? (pcl or pcl@) PCL is another Print Language supported by many vendors, including Hewlett-Packard, Lexmark, and others. It is essentially text with escape sequences to tell the print engine to place markings on a page at specific places in a specific font. It is the second most common format used with modern printers.
Text? (text or text@) Text is really just PCL without any control sequences. However, it is easy to have ifhp convert ordinary text into PCL by prefixing the appropriate PCL control codes. You may also need to use the crlf option to force CR to CR-LF translation. If you have a simple text printer then you may want to use the much easier to configure lpf filter from the LPRng distribution (http://www.lprng.com).
Vendor Specific There is a growing trend to have very proprietary Print Languages for very low end (less than $300) printers. These printers usually require all of their jobs to be preformated by software running on the host and to have the job delivered to them in a specific manner. If you have one of these printers, you will need to get a rasterizing program that produces the correct format. Check to see if GhostScript, supports your printer. If it does then you can use GhostScript to translate PostScript to your printer's required format.
Memory Size. If you are going to be sending large print jobs or ones with a large amount of graphics to the printer, you will need a substantial amount of memory to deal with rasterization. Most high resolution Laser Copier based printers require a minimum of 16 megabytes for adequate performance, and if you are printing complex PostScript or PDF documents you may want at least 32 megabytes. Color printers require substantially more and 64 megabytes is not uncommon.
Communications. The connection between your printer and the host computer.
Network Connection This is the most reliable and high speed way to connect a printer to a system. This is especially true if a printer must be accessible to multiple users and is located at a distance from the user.
Parallel Port (status@) The parallel port is a unidirectional communications channel and does not do full duplex bidirectional communications. Some operating system support bidirectional communications, but they do so by requiring write operations to alternate with read operations.
Serial Ports This is the very worst way to communicate at high speed with a printer. Serial ports usually have a high error rate, suffer from data overruns, and have a severe impact on system performance. You will need to configure your printer speed, format (bits per character, parity, stop bit), and flow control method, and then do the same for the host. This can be an endless source of frustration for the novice user.
Print Server Box Many older printers do not directly support a network connection and have an external print server box attached to either their serial or parallel ports. If you have the printer connected to a parallel port, then you will still most likely only have unidirectional communication and no status information will be available from the printer.
The most high speed and reliable connection to your printer is using a network connection. The following protocols are usually used to communicate with a network printer: RFC1179 (TCP/IP printing), Socket Protocol (TCP/IP), AppSocket Protocol (TCP/IP), Novell Print Protocol (IPX), SMB Print Protocol (TCP/IP), and AppleTalk Print Protocol (TCP/IP).
It is highly recommended that you use TCP/IP networking to communications to talk to your printer, and that you do not enable any other protocol on your printer. If you have two different systems trying to connect to the same printer using different protocols, a wide range of vendor's hardware will lock up and may require a power up reset to recover. Documented evidence for this behavior includes a wide range of printers, including those from Hewlett-Packard, LexMark, IBM and other vendors.
Only the TCP/IP based network job transfer protocols are discussed in this document. For details on using other protocols, please consult the consult the LPRng documentation.
RFC1179 is used to transfer print jobs between a client (user) and a print spooler, or between two print spoolers. Jobs are transferred as a set of files, and the only information exchanged during the transfer process is the success or failure of the transfer. In order to get status about the actual job printing, a separate query status (lpq) is sent to the print spooler.
Many, if not all, printers with a network interface that supports the TCP/IP protocol support the RFC1179 protocol for job transfer. However, their support for print job status is usually minimal to non-existent. If you want to send a job to a printer using the RFC1179 protocol, please be aware of the following problems.
Normally a print spooler (System 5 lp, BSD lpd, LPRng) does not modify a print job when forwarding it to another print spooler. This means that your print job will normally pass from the originating lp or lpr program to the destination printer with no changes. This can have disastrous results if the job requires filter processing.
If you are using the LPRng print spooler, job transfers using RFC1179 is specified by using :lp=spoolqueue@host or :rp=spoolqueue:rm=host printcap entries. For example:
raw:
:lp=raw@host
:sh:sf:mx=0
:sd=/var/spool/lp
cooked:
:rp=cooked:rm=host
:sh:sf:mx=0
:sd=/var/spool/lp
:filter=/usr/local/libexec/filters/ifhp
The raw queue does not have a filter and jobs sent to the raw are transfered intact from the raw queue to the destination raw printer on the host server.
Jobs sent to the cooked queue will be processed by the program specified by the filter option. For each data file in the job, the lpd print spooler will open a temporary file to hold the filter output, and then run the filter program with its STDIN set to the job's data file file and the STDOUT set to the temporary file. The filter STDERR will be recorded in an error log.
When a job is created a job format may specified (default is f), and an filter can be specified to process job files with this format. The :i<format> option specifies the filter program for use. For example, you can specify a different filter for the n format as shown below. The translate_format option specifies the resulting format for the processed files, and uses a format similar to the UNIX try(1) program. In the example, it specifies that the output of the filter for the n format be renamed as f.
cooked:
:rp=cooked:rm=host
:sh:sf:mx=0
:sd=/var/spool/lp
# default filter
:filter=/usr/local/libexec/filters/ifhp
# n filter
:nf=/usr/local/libexec/filters/nfilter
:translate_format=nf
There is a final option that is used when rather than having a set of job files forwarded to a printer, a single job file is desireable. This is usually the case when sending a job to a host or printer that has a defective RFC1179 spooler implementation, and drops or misprints jobs with multiple files in them. The lpd_bounce option causes the output of all the filters to be put into a single file, and the output is then forwarded to the destination. You can also use the bq_format option to specify the format of the job:
cooked:
:rp=cooked:rm=host
:sh:sf:mx=0
:sd=/var/spool/lp
# default filter
:filter=/usr/local/libexec/filters/ifhp
:lpd_bounce
# output has l (literal) or binary output
:bq_format=l
The lpr -l or lpr -b flag is used to specify the special literal or l job format. Job that have the l format usually have only the most perfunctory processing done by the filter.
Many printers with a network interface provide a TCP/IP port that is a direct connection to the internal print engine. If a TCP/IP connection is made to this port and a file is sent over this connection, then the print engine will process the file. More importantly, the connection is bidirectional, and the printer will report errors and status conditions over the connection. PJL and PostScript status request commands can be sent to the printer and the printer will respond with information.
The ifhp filter makes extensive use of this protocol, and provides support for status and error reporting. In cooperation with the LPRng print spooler, it will provide a detailed description of the actual print job progress and any error conditions that arise.
To use a Socket connection with LPRng, you use the :lp=host%port printcap entry shown below. The lpd print spooler will open a connection to the TCP/IP port on host and passes the (bidirectional) connection to the ifhp filter on file descriptor 1 (STDOUT) and the file to be printed on file descriptor 0 (STDIN). Errors and status information are reported by the ifhp filter on file descriptor 2 (STDOUT) and placed in the error status log by the lpd print spooler.
The connection made by the lpd server to the printer is persistent over the entire job; all file transfers for the same job are made over the same connection. This is important as it prevents other printer users from hijacking the printer in the middle of print a job and getting your job outputs mixed together.
The following is a typical printcap entry using the socket protocol.
The Tektronics Phaser Series printers and QMS printers use the Appsocket protocol when sending a job to the printer. This protocol uses two ports: a TCP/IP listening port which accepts TCP/IP connections and a UDP SNMP query port that is used to obtain status information.
The Appsocket protocol is (briefly):
The Simple Network Management Protocol (SNMP) is a UDP protocol. A SNMP Query packet containing a request for information is sent to the printers SNMP Agent port (port 161), and a reply containing the requested information is returned.
To send a job to the printer, a TCP/IP connection is opened to the TCP/IP port and job data is sent. Only a single job can be sent at a time - a EOJ in the job, i.e.- CTRL-D for PostScript or ESC E for PCL will cause the printer to terminate reading from the TCP/IP port, and after job processing has finished, to close the TCP/IP connection. All input after the EOJ may be ignored by the printer and not processed.
While processing the job, if bidirectional support is available and has been enabled the printer will return job status or information until all of the print job which is has received has been processed. This support is usually not enabled by default and must be enabled by using a specialized administration interface or configuration tool.
Unfortunately, some printers will also close the connection when the EOJ has been received. These printers are virtually useless when trying to get error or status information about a job.
Even more annoying is the behavior of some printers that insist on the network connection remaining open until the job has been processed. The device sending the job to the printer must do a shutdown on the sending direction of the network connection, and then read status information from the receiving direction until the printer terminates the connection. Unfortunately, some printers do not terminate the connection, and the the user must close the connection after a suitable timeout.
There are also printers that insist on the network connection being closed before they will start processing small jobs. The device sending the job to the printer must do a close rather than a shutdown.
While processing the job, the printer will ignore any connection requests, and only until the job has been processed will the printer accept connections.
During job processing, status and error indications can be obtained by sending a query to the UDP port. However, the error conditions and other information are not very precise as the status may change dramatically during job processing.
a query to the UDP port. However, the error conditions and other information are not very precise as the status may change dramatically during job processing.
The Appsocket protocol does not use a persistent connection. If two people are sending jobs to the printer simultaneously it is very likely that the jobs will get intermixed.
The appsocket option causes the ifhp filter to open and close a TCP/IP connection to the printer. In order to reopen the device, ifhp needs the device name. It gets this from the PRINTCAP_ENTRY environment variable which has the device information, or by using the TCP/IP address of the initial end of the connection.
The close_appsocket option causes the ifhp filter to close the connection after sending a job or part of a job. This is necessary with printers that will not start printing small jobs until a sufficient number of pages has been received.
The following is a sample printcap entry for this printer:
# Phaser Setup
# Appsocket
lp:server
:lp=10.0.0.1%9100
:sd=spooldir
:...
:ifhp=model=ps,appsocket
#path to ifhp filter
:filter=/.../ifhp
For your convenience, the model=phaser entry is suitable for use with the appsocket protocol.
snmp_monitor FLAG use snmp for status
snmp_program= path to snmp_printer_status
snmp_program_cfg= snmp_printer_status configuration file
snmp_model=snmp model information
snmp_sync_status=sync indicators
snmp_end_status=end of job indicators
snmp_end_status=end of job indicators
The ifhp filter can be configured to use the SNMP helper program snmp_printer_status to obtain SNMP status. This program is supplied as part of the ifhp distribution.
The snmp_monitor flag is used to enable the use of the snmp_printer_status program. The snmp_program specifies the program path and command line to invoke it. The snmp_program_conf specifies the path to the configuration file, snmp_printer_stastus.conf. The configuration file contains information about the operation of the program as well as the SNMP Object Identifiers (OIDs) for the status information.
Since different printers may not support all of the standard Printer MIB Oids, the snmp_printer_status.conf can identify the options on a per-printer model basis, and the appropriate ones can be selected using the snmp_model option.
The snmp_printer_status program returns status information on it STDOUT and errors on its STDERR. The status information has the format:
PRINTERNAME=HP LaserJet 2200
DEVICEID=HP LaserJet
STATUS=Ready
DEVICESTATUS=running
PRINTERSTATUS=idle
PAGECOUNT=30
When using snmp to detect idle or end conditions, the snmp_sync_status and the snmp_end_status values are used. If the retured status matches a field in the snmp_sync_status list, then a idle printer condtion is assumed. If the retured status matches a field in the snmp_end_status list, then an end of job condtion is assumed. For example:
When using SNMP to obtain status, it may be of little benefit to use other methods to obtain sync, pagecount, or end of job (waitend). Also, if a connection is open to the printer then the printer may never indicate idle or non-printing status. This problem can be avoided by using the appsocket protocol. If you use this, then you should also set the sync, waitend, and pagecount values to snmp as well. For example:
This will cause the ifhp to perform the operations but not to send any query strings to the printer.The following is a list of print server manufacturers, models, and with hints on how to access these boxes with various protocols.
Table 4-1. Network Print Servers
| Manufacturer | Model | RFC1179 Port Name (rp=XXX) | Send to TCP port |
|---|---|---|---|
| Digital Products Inc. | NETPrint Print Server | PORTn, where n is port on server | - Unknown if supported - |
| Electronics For Imaging Inc. | Fiery RIP i series | normalq or urgentq | - Unknown if supported - |
| Fiery RIP XJ series | xjprint | - Unknown if supported - | |
| Fiery RIP XJ+ and SI series | print_Model, e.g. print_DocuColor | - Unknown if supported - | |
| Fiery models ZX2100, ZX3300, X2, X2e | - Unknown if supported - | ||
| Emulex Corp. | NETJet/NETQue print server | PASSTHRU | - Unknown if supported - |
| Extended Systems Inc. | ExtendNet Print Server | Printern, where n is port on server | - Unknown if supported - |
| Hewlett-Packard | JetDirect interface card | raw | 9100 |
| JetDirect Print Server | Port1=raw1, Port2=raw2, ... | Port1=9100, Port2=9101, ... | |
| I-Data | Easycom 10 Printserver | par1 (parallel port 1) | - Unknown if supported - |
| Easycom 100 Printserver | LPDPRT1 | - Unknown if supported - | |
| IBM | Network Printer 12, 17, 24, and 24PS | PASS | - Unknown if supported - |
| Lantronix | EPS1, EPS2 | EPS_XXXX_S1 (serial) port 1, EPS_XXXX_P1 (parallel) port 2, etc. | 3001 (port 1), 3002 (port 2), etc. |
| QMS | Various Models | RAW | 35 (Appsocket) |
| Tektronix (Now Xerox) | Tektronix printer network cards | PS (PostScript), PCL (PCL), or AUTO(Auto-selection between PS, PCL, or HPGL). Not reliable. | 9100 (Appsocket on some models) |
| Rose Electronics | Microserve Print Servers | lp | 9100 |
| Xerox | Models 4505, 4510, 4517, 4520 | PASSTHRU | 2501 (Appsocket on some models) |
| Model 4512 | PORT1 | 10001 (programmable) | |
| Model N17 | RAW | 9100 | |
| Models N24 and N32 | RAW | 2000 | |
| Models 4900, 4915, 4925, C55 | PS | 2000 | |
| Document Centre DC220/230 | lp | - Unknown if supported - |
All company, brand, and product names are properties of their respective owners.
The ifhp filter may need to run a program such as ghostscript to do format conversion. For large files this can take quite a bit of time and most network printers have a connection timeout. If no data is received for this time the printer will close the connection. By default this timeout is fairly short: 30 or 90 seconds on most printers.
If you are sending large jobs to the printer using the socket protocol and are getting timeout problems due to conversion timeouts, then there are two solutions: a) use the Appsocket protocol, which will open and close the connection for each file, and only send data when the converted file is available, or b) do your conversions first and then spool the converted job to be sent directly to the printer. The second method requires an LPRng bounce queue.
# Method a) Appsocket
lp:server
:lp=10.0.0.1%9100
:sd=spooldir
:...
:ifhp=model=printer,appsocket
#path to ifhp filter
:filter=/.../ifhp
# Method b) Bounce Queue
# this queue does the conversion if required
lp:server
:lpd_bounce
:lp=real@localhost
:sd=spooldir
:...
:ifhp=model=printer
#path to ifhp filter
:filter=/.../ifhp
# this queue does transmission
real:server
:lp=10.0.0.1%9100
:sd=spooldir
:ifhp=model=printer
#path to ifhp filter
:filter=/.../ifhp
For method a), the Appsocket protocol is used and the ifhp filter will be invoked before sending a job. For method b), you use two queues: a bounce queue that does the format conversion and then sends the job to the real queue, and the real queue that actually talks to the printer.
Due to firmware problems in some PostScript and PCL printers, they will occasionally lock up and refuse to accept new connections or continue with job processing. This is extremely difficult to diagnose, as the printer appears to be functional but will simply not accept an