printcap(4) — File Formats
OSF — Environment_Note_Added
NAME
printcap − printer capability data base
SYNOPSIS
/etc/printcap
DESCRIPTION
The printcap file is a simplified version of the /etc/termcap database format, but is used to describe line printer characteristics. The host lpd line printer daemon accesses the /etc/printcap file every time a file is passed to the spooler for printing. The print spooling system uses the printcap file for dynamic addition and deletion of printers. Each entry in the printcap database is used to describe a single printer. This database may not be substituted as is possible with the /etc/termcap file because its substitution could cause printer accounting to be bypassed.
The default printer normally has the device reference lp, although environment variable PRINTER may be used to override this reference. Each spooling utility supports the option -Pprinter to allow explicit naming of a destination printer.
Printer Characteristic Parameters
Each printer served by the printer spooler has various characteristics that the lpd line printer daemon must know about to communicate with the printing device defined in the /dev directory. The following table lists the printer characteristic parameters.
Name2-character nmemonic used to define the parameter. The parameter must be specified exactly as it appears in this column.
TypeType of data expressed by the entry as str, num, or bool. When the parameter you define is referenced as a string variable (str) in the Type column, it must be followed by an = (equal sign) together with the string; when you do not define the string parameter, it remains a NULL string and contains no data or it takes the value specified in the Default column. When the Type column defines a parameter type as bool, it may only be logically true (yes) or logically false (no). When the parameter you define is a numerical variable, it must be followed with a # (pound sign) together with the numerical value you assign; when you do not define the numerical parameter it takes the value specified in the Default column of the table.
DescriptionDescription of the parameter. Refer to the termcap(4) reference page for a description of a typical printcap file layout.
| Name | Type | Default | Description |
| af | str | NULL | name of accounting file |
| br | num | none | if lp is a tty, set the baud rate (ioctl call) |
| cf | str | NULL | cifplot data filter |
| df | str | NULL | tex data filter (DVI format) |
| fc | num | 0 | if lp is a tty, clear flag bits (sgtty.h) |
| ff | str | \f | string to send for a form feed |
| fo | bool | false | print a form feed when device is opened |
| fs | num | 0 | like fc but set bits |
| gf | str | NULL | graph data filter (plot format) |
| hl | bool | false | print the burst header page last |
| ic | bool | false | driver supports (non standard) ioctl to indent printout |
| if | str | NULL | name of text filter that does accounting |
| lf | str | /dev/console | error logging filename |
| lo | str | lock | name of lock file |
| lp | str | /dev/lp | device name to open for output |
| mx | num | 1000 | maximum file size (in BUFSIZ blocks), zero = unlimited |
| nd | str | NULL | next directory for list of queues (unimplemented) |
| nf | str | NULL | ditroff data filter (device independent troff) |
| of | str | NULL | name of output filtering program |
| pc | num | 200 | price per foot or page in hundredths of cents |
| pl | num | 66 | page length (in lines) |
| pw | num | 132 | page width (in characters) |
| px | num | 0 | page width in pixels (horizontal) |
| py | num | 0 | page length in pixels (vertical) |
| rf | str | NULL | filter for printing FORTRAN style text files |
| rg | str | NULL | restricted group; only members of group allowed access |
| rm | str | NULL | machine name for remote printer |
| rp | str | lp | remote printer name argument |
| rs | bool | false | restrict remote users to those with local accounts |
| rw | bool | false | open the printer device for reading and writing |
| sb | bool | false | short banner (one line only) |
| sc | bool | false | suppress multiple copies |
| sd | str | /usr/spool/lpd | spool directory |
| sf | bool | false | suppress form feeds |
| sh | bool | false | suppress printing of burst page header |
| st | str | status | status filename |
| tf | str | NULL | troff data filter (cat phototypesetter) |
| tr | str | NULL | trailer string to print when queue empties |
| vf | str | NULL | raster image filter |
| xc | num | 0 | if lp is a tty, clear local mode bits (tty) |
| xs | num | 0 | like xc but set bits |
When the local line printer driver supports indentation, the lpd line printer daemon must understand how to invoke this capability.
Filter and Flags
The lpd line printer daemon creates a pipeline of filters to process files for various different printer device. The filters you select depend on the flags that are passed to the lpr command. The pipeline set up is:
| Flag | Filter | Description |
| none | if | regular text |
| -p | pr | if | regular text + pr |
| -c | cf | cifplot |
| -d | df | DVI (tex) |
| -g | gf | plot |
| -n | nf | ditroff |
| -f | rf | FORTRAN |
| -t | tf | troff |
| -v | vf | raster image |
The if filter is invoked with arguments:
if [−c] −wwidth −llength −iindent −nlogin −hhost acct-file
The −c flag is passed only when the −l flag (pass control-characters literally) is specified to the lpr command. The -wwidth and -llength parameters specify the page width and length (from the assigned or default values of pw and pl respectively in the printcap file) in characters. The −n and −h flags specify the login name and hostname of the owner of the job, respectively. The acct-file is passed from the af entry in the printcap file.
The if filter is opened for all individual jobs, which makes it suitable for accounting. When the if filter is not specified, the system uses the of filter as the default value. The of filter however, is opened only once and is only given the -wwidth and -llength flags.
All other filters are called as:
filter −xwidth −ylength −nlogin −h host acct-file
Where -xwidth and -ylength are represented in pixels as specified by the px and py entries, respectively, in the printcap file.
All filters take standard input (stdin) as the source file and standard output (stdout) as the destination. The printer may log either to standard error (stderr) or use syslogd, and must not ignore the SIGINT signal.
Error Logging
Error messages generated by the line printer programs (that is, the lp∗ programs) are logged by syslogd using the lpr facility. Messages printed on the stderr of one of the filters are sent to the corresponding lf file specified in the printcap file. The filters may, of course, also use syslogd.
Error messages sent to the console have a carriage return and a line feed appended to them, rather than just a line feed.
ENVIRONMENT NOTES
This section describes system features that are not generic to OSF/1 but that are provided in this OSF/1 implementation.
ULTRIX Compatibility
You can specify the following printer characteristic parameter:
xf
Specifies the pass-through filter name. This routine is specified when output is preformatted and does not require special filtering.
RELATED INFORMATION
Commands: lpc(8), lpd(8), pac(8), lpr(1), lpq(1), lprm(1)
Files: termcap