Before you do an installation, you should read the following instructions. You will need to:
HOWTO/ifhp-HOWTO.{ps,html,text,...}
file(s).
You are doing this now, so you are off to a good start.ifhp
filter with the working print spooler.In addition, you might want to get the following software,
which can be used with
ifhp
.
http://www-inf.enst.fr/~demaille/a2ps/ This package does a very good job of text to PostScript conversion.
http://www.gnu.org/ This package is a simpler version of a2ps, and is faster and smaller.
ftp://ftp.astron.com/pub/file/ or ftp://ftp.deshaw.com/pub/file/.
The ifhp
filter uses the AUTOCONF configuration facilty.
The following set of commands will generate configuration files
and compile and install the software and documentation.
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 /usr/local/lib/filters
# installs ifhp.conf in /etc
# (if already present, in /etc/ifhp.conf.sample)
make install
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 -Toptions
:of=/.../ifhp -Toptions
# version 2 - using ifhp printcap entry
:ifhp=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.
Since commas are used to separate options in the
-T
option list,
if you want to specify an option with a list of values
the values need to separated with a semicolon
(;
)
as shown below:
ifhp -Tconfig=./ifhp.conf;/etc/ifhp.conf;./ifhp.conf
By convention,
the
ifhp
filter takes its input from STDIN (file descriptor 0)
and expects to write its output to STDOUT (file descriptor 1),
which is normally connected to a printer.
Error and trace information are written to STDERR (file descriptor 2).
As shipped,
the
ifhp.conf
file is configured to support a PJL printer which has
the following configuration.
The configuration flags that support or enable these
features are shown as well.
pjl
).ps
).pcl
).text
, default_language=pcl
).banner@
)status
)sync
)pagecount
)The following printers have specfic configuration sections
which are invoked by using the
model=name
option.
The HP DeskJet and DesignJet printers use the same
hpdj
prefix with the model appended.
See Appendix A in the Printer Job Language Technical Reference Manual
for a detailed explanation of these names.
apple hp4000 hp4 hp4l hp4lc
hp4m hp4ml hp4mp hp4mplus hp4mv
hp4p hp4pj hp4plus hp4si hp4simx
hp4v hp5 hp5l hp5m hp5mp
hp5p hp5si hp5simopier hp5simx hp6l
hp6mp hp6p hpcolorlj5 hpcolorlj5m hpcolorlj
hpdj1200c hpdj1600c hpdj2000cp hpdj200 hpdj220
hpdj230 hpdj2500cp hpdj250c hpdj330 hpdj350c
hpdj350c hpdj430 hpdj450c hpdj455ca hpdj600
hpdj650c hpdj700 hpdj750c hpdj750cplus hpdj755cm
hpiiisi hpljpro hppjxl300 postscript ps
tek qms1725
In addition to HP printers, there is also generic support for PostScript only printers.
This is the most common configuration, and 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
: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
:if=/.../ifhp
:of=/.../ifhp
If you have an HP printer in the above list, you can use:
# 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
:ifhp=model=name
#path to ifhp filter
:if=/.../ifhp
:of=/.../ifhp
Since the parallel port is unidirectional,
you cannot get status back,
and need to use the
status@
option to prevent the
ifhp
filter from expecting it.
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
:sd=spooldir
:...
# parallel port
:lp=/dev/lpt
:ifhp=status@
#path to ifhp filter
:if=/.../ifhp
:of=/.../ifhp
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
Use the configuration appropriate to the printer connection,
and then use the
pjl@
, pcl@
, and text@
option to inhibit everything but PostScript.
# printer setup
# force clients (lpr, lpq, to use server)
lp:lp=lp@serverhost
# server information
lp:server
:sd=spooldir
:...
:ifhp=pcl@,pjl@,text@
#path to ifhp filter
:if=/.../ifhp
:of=/.../ifhp
If you have a parallel port printer with no PostScript support, you would use:
:ifhp=pcl@,pjl@,text@
An alternative is to use the
model=ps
configuration section of the default
/etc/ifhp.conf
file.
# 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 your printer does not like to have a PostScript EOJ (Control-D)
flag at the start of a job,
use the
no_ps_eoj
(
No PS EOJ at Start) flags.
flag to remove them.
You can use the PostScript Only configuration above,
and add text to postscript conversion to it.
This is done by defining the pathname to a text to PostScript
conversion program and causing ifhp to use the
program to convert the input file to PostScript.
The
a2ps
program can be obtained from
http://www-inf.enst.fr/~demaille/a2ps/
and does an excellent job.
Also,
the
textps
program included with this distribution does a (barely) adequate job as well.
The method outlined here assumes that the input file
is a text file and that the a2ps
program will convert it.
The
a2ps
program needs to be explicitly told that output
is to go to
STDOUT
or file descriptor 1.
text_converter=/usr/local/bin/a2ps -o-
text_converter_output=ps
tempfile=/var/tmp/ifhp
# printer setup
# force clients (lpr, lpq, to use server)
lp:lp=lp@serverhost
# server information
lp:server
:sd=spooldir
:...
:ifhp=pcl@,pjl@,text@,text_converter=...,\
text_converter_output=ps
#path to ifhp filter
:if=/.../ifhp
:of=/.../ifhp
The Tektronics Phaser Series printers use the Appsocket protocol when sending a job to the printer. This protocol is (briefly):
The ifhp
program supports the appsocket
protocol.
In order to do so,
the following ifhp configuration entry can be used.
[ tek ]
appsocket
pjl@
pcl@
The appsocket
option will use the appsocket protcol,
and cause ifhp
to open and close connections to the printer.
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