printcap(5)
Name
printcap − printer capability data base
Syntax
/etc/printcap
Description
The printcap file describes the printers available on a system. There is one entry in the file for each printer, and the entry describes the printer capabilities. A change to the printcap file immediately affects the spooling system, unless the affected queue is active. In this case, the spooling queue should be stopped and restarted. For more information, refer to lpc(.).
Entries in the printcap file comprise a number of fields separated by colons (:). The first entry for each printer gives the names that are known for the printer. The names are separated by the pipe character (|). The first name is the name of the printer that is displayed when you use the lpc command to show the status of a queue. Second and subsequent names are alternative names for the printer. You can use the last name to fully identify the printer, including blanks for readability if necessary.
The /etc/printcap file is created when the system is installed. After this, you can modify the printcap file by using the lprsetup script or a suitable editor. The lprsetup script is described on the lprsetup() reference page and in the Guide to System and Network Setup.
When a file is printed using the lpr command, the file can be sent to a named printer. If a printer is not named, and a print name is not defined by the PRINTER environment variable, the file is sent to the printer with the name “lp” in the printcap file. The printcap file should always have a printer with the name “lp”.
Examples
The following examples show the format of entries created using the lprsetup script.
A typical entry for a printer in the printcap file is:
lp|lp0|nlp|ln03 in room 4:\
:af=/usr/adm/lpacct:\
:br#4800:\
:fc#0177777:\
:fs#03:\
:if=/usr/lib/lpdfilters/ln03of:\
:lf=/usr/adm/lperr:\
:lp=/dev/tty00:\
:mx#0:\
:of=/usr/lib/lpdfilters/ln03of:\
:pl#66:\
:pw#80:\
:sd=/usr/spool/lpd:\
:xc#0177777:\
:xs#044000:
A typical entry for a PrintServer in the printcap file is:
lp0|lp|0:
:ct=network:\
:lf=/usr/adm/lpd-errs/ex1:\
:of=lpscomm dotty %U %H %J:\
:ps=LPS:\
:sd=/usr/spool/lpd/ex1:\
:uv=4.0:\
:Da=ascii:\
:Dl=/usr/lib/lpdfilters/lps_v3.a:\
:Sd=a:\
For more information, refer to the Guide to System and Network Setup .
Capabilities
There are three types of capabilities in the printcap file: Boolean, string, and numeric. String valued capabilities are processed before use. For more details, refer to termcap(.). The following list contains the names of capabilities that can be used in the printcap file:
| Name | Type | Default | Description |
| af | str | not set | Accounting file name |
| br | num | not set | Baud rate, set if lp is a tty |
| (ioctl call) | |||
| cf | str | not set | Cifplot data filter |
| ct | str | dev | Connection type - only valid |
| when uv=psv4.0 (choices are: | |||
| dev, lat, remote, network) | |||
| db | num | 0 | Debugging level (choices are: |
| 0 (none), 1 (normal), 10 | |||
| (do not execute job, describe | |||
| actions to log file)) | |||
| df | str | not set | Text data filter (DVI format) |
| du | num | Daemon user id | |
| fc | num | 0 | If lp is a tty, clear octal |
| flag values ( tty() sg_flags) | |||
| ff | str | \f | String to send for a form feed |
| fo | bool | false | Print a form feed when device |
| is opened | |||
| fs | num | 0 | If lp is a tty, set octal flag |
| values ( tty() sg_flags) | |||
| gf | str | not set | Graph data filter (plot(1g) |
| format) | |||
| if | str | not set | Text filter that does |
| accounting | |||
| lf | str | /dev/console | Error logging file name |
| lo | str | lock | Lock file name |
| lp | str | /dev/lp | Device name to open for output |
| mc | num | Maximum number of copies allowed | |
| mx | num | 1000 | Maximum file size (in 1kbyte |
| blocks), 0 = unlimited | |||
| nf | str | not set | Ditroff (device independent |
| troff) data filter | |||
| of | str | not set | Output filtering program name |
| op | str | not set | The entry in the “Name” field |
| for LAT port characteristics | |||
| os | str | not set | Service name supported on some |
| terminal servers | |||
| pl | num | 66 | Page length (in lines) |
| pp | str | /bin/pr | Print filter |
| ps | str | non_PS | Printer type (choices are: |
| non_PS, PS, LPS) | |||
| pw | num | 132 | Page width (in characters) |
| px | num | 0 | Page width in pixels |
| py | num | 0 | Page length in pixels |
| rf | str | not set | Filter for printing Fortran style |
| text files | |||
| rm | str | not set | 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 as well as 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 banner |
| page header | |||
| st | str | status | Status file name |
| tf | str | not set | Troff data filter (CAT |
| phototypesetter) | |||
| tr | str | not set | Trailer string to print when |
| queue empties | |||
| ts | str | not set | LAT terminal server node name |
| uv | str | 3.0 | ULTRIX version number (choices |
| are: 3.0, 4.0) | |||
| vf | str | not set | Raster image filter |
| xc | num | 0 | If lp is a tty, clear local |
| mode octal values ( tty() “Local mode”) | |||
| xf | str | not set | Transparent mode filter |
| xs | num | 0 | If lp is a tty, set local mode |
| octal values ( tty() “Local mode”) |
The ct entry specifies the connection type; these are device, LAT, remote or network. To enable print server support you must ensure the :ct=network: entry is included in the printcap file for the appropriate print queue.
The uv entry specifies the version number of the ULTRIX operating system. This entry allows backward compatibility with earlier versions of the print system. Ensure that :uv=4.0:, otherwise the print queue functions as it did in Version 3.1 or earlier and you will not be able to access the features for PostScript support.
The ps entry specifies the printer type. You must ensure the :ps=LPS: entry is included in the printcap file for all print queues using print server features.
The following capabilities set defaults for PostScript printers. You should refer to the lpr() reference page for the choices available for each capability. The equivalent lpr options are shown for reference purposes.
| Name | Type | Default | Description | lpr Option |
| Da | str | postscript | Data type | −D |
| It | str | not set | Input tray | −I |
| Lu | str | not set | Layup definition file | −L |
| Ml | str | not set | Record messages | −M |
| Nu | str | not set | Number up | −N |
| Or | str | portrait | Orientation | −O |
| Ot | str | not set | Output tray | −o |
| Ps | str | not set | Page size | −F |
| Sd | str | a | Default sheet size | |
| (see below) | ||||
| Si | str | not set | Sides | −K |
| Ss | str | not set | Sheet size | −S |
| Tr | bool | true | Trailer page | |
| Ul | str | <last page> | Upper page limit | −Z |
| Xf | str | xlator_call | Translator dispatch | |
| program | ||||
| Lf | str | layup | Layup to PostScript | |
| translator | ||||
| Dl | str | not set | Name of the device |
The Ss capability specifies a mandatory sheet size. The print job fails if this sheet size is not available with the printer.
The Sd capability specifies a preferred sheet size and is overridden by the Ss capability and the lpr −S command. For American A size paper (8.5 x 11 inches) ensure the entry is :Sd=a:. For European A4 size paper (8.3 x 11.7 inches) ensure the entry is :Sd=a4:. If the sheet size specified by the Sd capability is not available, the print job does not fail, but is printed on the default sheet size for the printer.
The Dl capability specifies the name of the device control module library file. If the print server supporting host is Version 2.0 or 2.1, the Dl entry should be:
:Dl=/usr/lib/lpdfilters/lps_v2.a:\
If the print server supporting host is Version 3.0, the Dl entry should be:
:Dl=/usr/lib/lpdfilters/lps_v3.a:\
If the Dl entry does not match the version of the PrintServer supporting host software, the job flag page prints, but the job itself may not.
See Also
lpq(1), lpr(1), lprm(1), termcap(5), lpc(8), lpd(8), pac(8)
Guide to System and Network Setup