printcap(5) —
NAME
printcap − printer capability database
SYNOPSIS
/etc/printcap
DESCRIPTION
printcap is a simplified version of the termcap database used to describe line printers. The spooling system accesses the printcap file every time it is used, allowing dynamic addition and deletion of printers. Each entry in the database is used to describe one printer.
The default printer is normally lp, though the environment variable PRINTER may be used to override this. Each spooling utility supports an option, −Pprinter, to allow explicit naming of a destination printer.
Refer to the “Line Printer Spooler Manual” for a complete discussion on how to set up the database for a given printer.
Capabilities
Each entry in printcap describes a single printer and consists of a number of fields separated by colons (:). The first entry for each printer specifies the names that are known for the printer, separated by pipe symbols (|). The first name is typically a shorthand name to be used by users, while the last name given should be a long name fully identifying the printer; any other names are understood as synonyms for the printer name. All names but the last should be in lowercase letters and contain no blanks; the last name may contain uppercase letters and blanks for readability.
All printcap capabilities are specified using two-character codes and may be of three basic types:
Boolean
Capabilities that indicate that the printer has some particular feature. Boolean capabilities are simply written between the two colons, i.e., “:sh:” would indicate that headers should be suppressed.
Numeric
Capabilities that supply some sort of numeric value, such as the width or number of lines per page. They are expressed as the name, followed by the “#” sign, followed by the numeric value. An example would be “:pl#66:” to indicate that the printer prints 66 lines per page.
String
Capabilities that specify items such as file names or character sequences to be passed to the printer. These are specified as the name, followed by the “=” sign, then the string value. An example is “:lp=/dev/lp0:” to specify that a printer is connected to /dev/lp0.
An example:
lp|Panasonic 4450 laser printer:\
:lp=/dev/tty04:\
:tt=B19200+CS8+IXON+IXOFF+CREAD+CLOCAL\
:lf=/usr/adm/lpd-errs:\
:sh:sd=/usr/spool/lpd:
This example is for the system default printer (lp), with a longer description indicating that it is a Panasonic 4450 laser printer. The lp= capability shows it is connected to the device /dev/tty04, the tt= field specifies the communication parameters to use, and the lf= entry causes any errors to be logged to the file /usr/adm/lpd-errs. Additionally, the sh boolean capability indicates that only short headers should be printed, and all jobs sent to this printer will be spooled to the directory /usr/spool/lpd, as specified by sd=.
This is a complete list of all printcap capabilities used by lpd:
NameType Default Description
afstrNULLname of accounting file
brnumnoneif lp is a tty, set the baud rate (ioctl call)
ccnum0if lp is a tty, bits to clear in c_cflag
cfstrNULLcifplot data filter
csnum0if lp is a tty, bits to set in c_cflag
dfstrNULLtex data filter (DVI format)
ffstr\fstring to send for a form feed
foboolfalseprint a form feed when device is opened
gfstrNULLgraph data filter (plot(3X) format)
hlboolfalseprint the burst header page last
icnum0if lp is a tty, bits to clear in c_iflag
ifstrNULLname of text filter that does accounting
isnum0if lp is a tty, bits to set in c_iflag
lfstr/dev/consoleerror logging file name
lostrlockname of lock file
lpstr/dev/lpdevice name to open for output
mxnum1000maximum file size (in BUFSIZ blocks),
zero = unlimited
ndstrNULLnext directory for list of queues
(unimplemented)
nfstrNULLditroff data filter
(device-independent troff)
ocnum0if lp is a tty, bits to clear in c_oflag
ofstrNULLname of output filtering program
osnum0if lp is a tty, bits to set in c_oflag
pcnum200price per foot or page in hundredths
of cents
plnum66page length (in lines)
pwnum132page width (in characters)
pxnum0page width in pixels (horizontal)
pynum0page length in pixels (vertical)
rfstrNULLfilter for printing FORTRAN-style
text files
rgstrNULLrestricted group; only members of group
allowed access
rmstrNULLmachine name for remote printer
rpstrlpremote printer name argument
rsboolfalserestrict remote users to those with
local accounts
rwboolfalseopen the printer device for reading
and writing
sbboolfalseshort banner (one line only)
scboolfalsesuppress multiple copies
sdstr/usr/spool/lpd spool directory
sfboolfalsesuppress form feeds
shboolfalsesuppress printing of burst page header
ststrstatusstatus file name
tfstrNULLtroff data filter (C/A/T phototypesetter)
trstrNULLtrailer string to print when queue empties
ttstrNULLgetydefs-like string specifying values
to set and clear in termio structure
vfstrNULLraster image filter
Filters
The lpd(1M) daemon creates a pipeline of filters to process files for various printer types. The filters selected depend on the flags passed to lpr(1). The pipeline set up is:
−ppr | ifregular text + pr(1)
noneifregular text
−ccfcifplot
−ddfDVI (tex)
−ggfplot(3X)
−nnfditroff
−frfFortran
−ttftroff
−vvfraster image
The if filter is invoked with arguments:
if [ −c ] −wwidth −llength −iindent −n login −h host acct-file
The −c flag is passed only if the −l flag (pass control characters literally) is specified to lpr. width and length specify the page width and length (from pw and pl respectively) in characters. The −n and −h parameters specify the login name and host name of the owner of the job respectively. acct-file is passed from the af printcap entry.
If no if is specified, of is used instead, with the distinction that of is opened only once, while if is opened for every individual job. Thus, if is better suited to performing accounting. The of is only given the width and length flags.
All other filters are called as:
filter −xwidth −ylength −n login −h host acct-file
where width and length are represented in pixels, specified by the px and py entries respectively.
All filters take stdin as the file, stdout as the printer, may log to stderr or use syslog(3I), and must not ignore SIGINT.
Logging
Error messages generated by the line printer programs themselves (that is, the lp* programs) are logged by syslog(3I) using the lpr facility. Messages printed on stderr associated with one of the filters are sent to the corresponding lf file. The filters may, of course, use syslog themselves.
Error messages sent to the console have a carriage return and a line-feed character appended to them, rather than just a line-feed character.
SEE ALSO
lpc(1M), lpd(1M), lpr(1), lpq(1), lprm(1), syslog(3I).
tty(7) in the INTERACTIVE UNIX System User’s/System Administrator’s Reference Manual.
plot(3X) in the INTERACTIVE SDS Guide and Programmer’s Reference Manual.
“Line Printer Spooler Manual.”
\*U — Version 1.0