| Sidebar: A printcap Entry Dissected
 
The following is a printcap entry I set up on one of
the systems 
I manage. It shows several features of a normal printcap
entry 
extended with optional filters. This entry is for a
Hewlett-Packard 
LaserJet III connected to a Sun SPARCSTATION 10 using
a null modem 
cable attached to serial port A. 
 
lj|lj3|laser jet 3|:\
:lp=/dev/ttya:br#9600:\
:ms=pass8,opost,ixon,onlcr,crtscts:\
:sd=/var/spool/lpd:\
:lf=/var/adm/lpd-errs:sh:mx#0:\
:if=/usr/local/lib/filters/sethp:\
:cf=/usr/local/lib/filters/setland:\
:df=/usr/local/lib/filters/setnomarg:\
:nf=/usr/local/wp/shbin/wpp: 
 
printcap entries consist of one line of data. Each entry
option 
is separated by a colon. Empty options are allowed,
so that :: 
is okay. When the line is too long, a backslash ("\")
extends 
the entry to the next lines. For more information, see
printcap(5). 
The sample entries have the following meanings: 
lj|lj3|laser jet 3|: The first entry lists 
names or aliases of the printer, each separated by the
vertical bar 
("|"). Thus, to use this printer, users may
type lj 
or lj3. One printer in the printcap should have the
name lp, representing the system's default printer. 
lp=/dev/ttya: This is the physical device 
the printer is attached to -- in this case, serial port
a. 
br#9600: This is the baud rate to use for 
serial communications. Note that a "#" is
used between the 
br option and its value. This convention for numeric
options 
is comparable to the "=" used for string options. 
ms=pass8,opost,ixon,onlcr,crtscts: This option 
holds several communications parameters (see stty(1)). 
sd=/var/spool/lpd: This is the spool directory. 
Files destined for this printer are copied here. 
lf=/var/adm/lpd-errs: This is the file to 
use for logging errors. 
sh: This says that the header page should 
not be printed. This is a boolean option and is not
followed by a 
value. The value is implied by the option's presence. 
mx#0: This tells the largest file printable 
in bytes. Setting mx to 0 removes the size limitation. 
if=/usr/local/lib/filters/sethp: This is 
the input filter to use if no other filter is specified
on the command 
line. sethp initializes the printer, then sends the
print 
job unchanged to the printer.  
cf=/usr/local/lib/filters/setland: This is 
a filter invoked with the -c option on lpr's command
line. setland puts the printer in landscape mode before
sending 
the print job.  
df=/usr/local/lib/filters/setnomarg: This 
is another filter, invoked with the -d option. setnomarg
sets the margins as close to the edge of the paper as
possible and 
changes to a smaller font. 
nf=/usr/local/wp/shbin/wpp: This is a filter 
installed in printcap by the WordPerfect installation
program. 
Some printcap entries include fc and fs options. 
These options clear or set bits to fine-tune the serial
communications 
used by the print system. I try to avoid using them
if I can, as they 
are rather confusing. Information for which bits to
set is spread 
among several man pages and include files (the .h 
files in the /usr/include directory). The ms option
is usually sufficient for what you want to do.  
 
 
 |