Next Previous Contents

2. Installation and Express Configuration

Before you do an installation, you should read the following instructions. You will need to:

  1. Use GNU Make. Don't even think about trying to use another make unless you are a Wizard. And even the Wizards would download the GNU Make.
  2. Use an ANSI C compiler.
  3. Read the HOWTO/IFHP-HOWTO.{ps,html,text,...} file(s). You are doing this now, so you are off to a good start.
  4. Generate and install the software.
  5. Run some simple standalone tests, i.e. - without using the print spooler.
  6. Modify the printcap files and/or add other information to the printcap files.
  7. Try the ifhp filter with the working print spooler.

In addition, you might want to get the following software, which can be used with ifhp.

a2ps - Ascii Text To PostScript Converter

http://www-inf.enst.fr/~demaille/a2ps/ This package does a very good job of text to PostScript conversion.

enscript - GNU Enscript

http://www.gnu.org/ This package is a simpler version of a2ps, and is faster and smaller.

Unix File Utility - Determines the type of file

ftp://ftp.astron.com/pub/file/ or ftp://ftp.deshaw.com/pub/file/.

LPRng Print Spooler

http://www.astart.com

2.1 Configure and Compilation

The ifhp filter uses the autoconf configuration facility. This facility will determine your system type, set compilation flags, and initialize shell and make variables that determine where your software will be installed. You should be aware of the following variables used by configure.

default installation directories:
 ${prefix}  is usually /usr/local
 ${exec_prefix} is usually ${prefix} (/usr/local)
 ${libexecdir} is usually ${exec_prefix}/libexec (/usr/local/libexec)
 ${sysconfdir} is usually ${prefix}/etc (/usr/local/etc)
 ${mandir} is usually ${prefix}/man     (/usr/local/man)

We install the components in:
 ${libexecdir}/filters/ ifhp, ofhp, etc
 ${sysconfdir}/ifhp.conf    - configuration file
 ${mandir}/man8/ifhp.8      - man pages

These defaults are the most useful when you are installing software on a new system. Suppose you wanted to install in /usr/lib/filters, /etc, and /usr/share/man. Then you would use:

configure --libexecdir=/usr/lib/filters --sysconfdir=/etc --mandir=/usr/share/man

It is highly unlikely that you will encounter problems with compilation. Usually these are due to type definition conflicts in include files. If you encounter these, please report these to the LPRng mailing list.

configure
make all
# installs ifhp and textps in ${libexecdir}# installs ifhp.conf in ${sysconfdir} (if not present)
#  and in ${sysconfdir}/ifhp.conf.sample
make install

2.2 Configuring IFHP and Model Information

There are over 500 different printer models, types and configurations supported by IFHP. If your printer is not currently supported, then report this to the LPRng Mailing List and more than likely support will be added.

In order to support a printer, the printer capabilities and its connection method must be told to the ifhp filter. This information is known as a printer configuration, and the printer configuration databases is stored in the ifhp.conf configuration file. The particular entry or printer model is accessed using the ifhp model option.

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 the following capabilities:

  1. PJL support (pjl).
  2. PostScript (PS) support (ps).
  3. PCL support (pcl).
  4. Text files printed as PCL (text, default_language=pcl).
  5. Banner printing done by LPRng spooler (banner@)
  6. Status reported from printer (status)
  7. Synchronize at start and end (sync)
  8. Get pagecount information (pagecount)

In addition to HP printers, there is also generic support for PostScript only printers (/tt/ps/), Tektronics Phasers (tek), Tektronics Phasers (tek), QMS printers (qms), and others. The HP DeskJet and DesignJet printers hpdj prefix with the model appended. These provide additional configuration information, such as limitations on printing capability, etc.

apple           hp5             hpdj1600c       hpdj750cplus
hp4             hp5l            hpdj200         hpdj755cm
hp4000          hp5m            hpdj2000cp      hpiiisi
hp4l            hp5mp           hpdj220         hpljpro
hp4lc           hp5p            hpdj230         hppjxl300
hp4m            hp5si           hpdj2500cp      lexmark4039
hp4ml           hp5simopier     hpdj250c        phaser
hp4mp           hp5simx         hpdj330         postscript
hp4mplus        hp6l            hpdj350c        ps
hp4mv           hp6mp           hpdj430         qms1725
hp4p            hp6p            hpdj450c        qms2025
hp4pj           hp8100          hpdj455ca       qms2060
hp4plus         hpcolorlj       hpdj600         qms860
hp4si           hpcolorlj5      hpdj650c        tek
hp4simx         hpcolorlj5m     hpdj700
hp4v            hpdj1200c       hpdj750c        default

2.3 Printcap Information

The basic LPRng printcap configuration is:

# printer setup
# force clients (lpr, lpq, to use server)
lp:lp=lp@serverhost
# server information
lp:server
  :sd=spooldir
  :...
  
  # version 1 - using -T options
  #path to ifhp filter
  :if=/.../ifhp -Tmodel=model,options
  :of=/.../ifhp -Tmodel=model,options
  
  # version 2 - using ifhp printcap entry
  :ifhp=model=model,options
  :if=/.../ifhp
  :of=/.../ifhp

As shown, options can be passed on the command line using the -Toption,option method or put into the :ifhp=option,option list. There can be multiple -T options on a command line, but only a single :ifhp printcap entry.

Since commas are used to separate options in the -T option list, separate values with a semicolon. You will need to quote this on a command line:

ifhp "-Tconfig=/usr/local/etc/ifhp.conf;/var/spool/ifhp.conf"

As shown in the example above, you specify the printer model by using the -Tmodel=

2.4 PS, PCL, PJL Printer with Network Connection

This is the most common configuration, and the printcap entry would have the following format. The actual port for a direct connection to the printer may vary. For HP JetDirect print spooling support it is 9100. For others, please consult the manufacturers documentation for details.

# printer setup
# force clients (lpr, lpq, to use server)
lp:lp=lp@serverhost
# server information
lp:server
  :sd=spooldir
  :...
  #:lp=printer ip address or DNS name%9100
  # eg - :lp=nwpr%9100
  # eg - :lp=10.1.1.1%9100
  :lp=10.1.1.1%9100
  #path to ifhp filter
  :ifhp=model=name
  :if=/.../ifhp
  :of=/.../ifhp

If your printer is actually a parallel or serial port printer and is attached to an external Network Print Spooler unit, then even though the connection to the Network Print spooler is bidirectional, no status information will be returned from the printer. In this case you should use status@ option to tell ifhp not to expect status. This is done using:

lp:server
  :...   :ifhp=status@,model=name

2.5 PS, PCL, PJL Printer with Parallel Port Connection

Since the parallel port is unidirectional, you cannot get status back from the printer when queried for it, may need to use the status@ option to prevent the ifhp filter from expecting it. You must not specify the :rw (open connection read-write) printcap option. The printcap entry would have the following format:

# printer setup
# force clients (lpr, lpq, to use server)
lp:lp=lp@serverhost
# server information
lp:server
  # no :rw option!
  :sd=spooldir
  :...
  # parallel port
  :lp=/dev/lpt
  :ifhp=status@
  #path to ifhp filter
  :if=/.../ifhp
  :of=/.../ifhp

2.6 PS, PCL, PJL Printer with Serial Port

The LPRng print spooler will open and set the serial line characteristics, and pass the open connection to the ifhp filter. The tty connection must pass all 8 bits with no parity, and should use hardware flow control if at all possible. for your system,

# printer setup
# force clients (lpr, lpq, to use server)
lp:lp=lp@serverhost
# server information
lp:server
  :sd=spooldir
  :...
  # serial port
  :lp=/dev/ttyxxx
  :stty=38400 -echo -crmod -raw -oddp -evenp \
   ixon pass8 -ixany cbreak crtscts
  #path to ifhp filter
  :if=/.../ifhp
  :of=/.../ifhp

2.7 PostScript Only Printer

Use the configuration appropriate to the printer connection, and then specify model=ps.

# printer setup
# force clients (lpr, lpq, to use server)
lp:lp=lp@serverhost
# server information
lp:server
  :sd=spooldir
  :...
  :ifhp=model=ps
  #path to ifhp filter
  :if=/.../ifhp
  :of=/.../ifhp

If you have a parallel port printer with no PostScript support, you would use:

:ifhp=model=ps,status@

If your printer does not like PostScript EOJ (Control-D) flags at the start of a job, use the no_ps_eoj ( No PS EOJ at Start) flags. flag to remove them.

:ifhp=model=ps,no_ps_eoj

2.8 PostScript Only Printer Text Conversion

If ifhp.conf can be configured to invoke a text to PostScript converter. See the section on File Utility and Conversion capability.

2.9 Tektronics Phaser and QMS Printers with Network Connections

The Tektronics Phaser Series printers and QMS printers use the Appsocket protocol when sending a job to the printer. This protocol is (briefly):

  1. The Tektronics printers listens for TCP/IP connections on port 9100 and for UDP packets on port 9101, which the QMS printers listens for TCP/IP connections on port 35 and for UDP packets on port 35. These port numbers can be changed using the printer front panel or by various configuration utilities.
  2. When a UDP packet is received on the UDP port a reply packet containing the status is returned to the originator's address. This packet contains an status indication, in a undefined format.
  3. To send a job to the printer, a TCP/IP connection is opened to the TCP/IP port and a PostScript job is sent. Only a single job can be sent at a time - a EOJ (CTRL-D) will terminate input and flush all following jobs.
  4. Return status will be sent in the reverse direction until the job has completed, at which point the connection will be closed.

The ifhp program supports the appsocket protocol. In order to do so, the following ifhp configuration entry can be used.

[ tek ]
appsocket
pjl@
pcl@
[ qms ]
appsocket
qms
pjl@
pcl@
The appsocket option will use the appsocket protocol, and cause ifhp to open and close connections to the printer. The qms option will cause the same number port to be used for the TCP/IP and UDP port. The printcap entry should specify lp=/dev/null and provide the device IP address using the -Tdev=host%port option.
# Phaser Setup lp:server
  :lp=/dev/null
  :sd=spooldir
  :...
  :ifhp=model=tek,dev=10.0.0.1%9100
  #path to ifhp filter
  :if=/.../ifhp
  :of=/.../ifhp

2.10 IFHP Filter and Timeout Problems

If the ifhp filter needs to invoke a conversion filter then the conversion process can take a considerable amount of time. Since the output of the filter is not sent until the filter completes, then no job information will get sent to the printer. This can lead to a filter timeout. If this is a problem, then the appsocket protocol and the appsocket protocol can be hideously abused and the reopen_for_job option used order to solve this problem. The following printcap entry is used:

# Phaser Setup lp:server
  :lp=/dev/null
  :sd=spooldir
  :...
  :ifhp=model=printer,dev=10.0.0.1%9100,appsocket,reopen_for_job
  #path to ifhp filter
  :if=/.../ifhp
  :of=/.../ifhp

The appsocket option forces a connection to be made to the printer. The reopen_for_job option will force the connection to be re-established immediately before any data is sent. This will, in effect, terminate the waiting connection and force a new one to be made.


Next Previous Contents