If a printer is specified via
lp (either local or remote), the
lpd(8) daemon creates a pipeline of
filters to process files for various printer types. The pipeline is not set up for remote printers specified via
rm unless the local host is the same as the remote printer host given. The filters selected depend on the flags passed to
lpr(1). The pipeline set up is:
p pr | if regular text + pr(1)
none if regular text
c cf cifplot
d df DVI (tex)
g gf plot(3)
n nf ditroff
o pf PostScript
f rf Fortran
t tf troff
v vf raster image
The
if filter is invoked with arguments:
if [-c] -wwidth -llength -iindent -n login [-j jobname] -h host acct-file
The
-c flag is passed only if the
-l flag (pass control characters literally) is specified to
lpr(1). The
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. The
-j parameter is optional and specifies the name of the print job if available. The
acct-file option 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 [-j jobname] -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 either to
stderr or using
syslog(3), and must not ignore
SIGINT.
Filters can communicate errors to lpd by their exit code and by modifying the mode of the spool lock file as follows:
1
An attempt is made to reprint the job and mail is sent if it fails.
2
lpd(8) silently discards the job.
n
lpd(8) discards the job and mail is sent.
u+x
Stop printing and leave queue disabled (S_IXUSR).
o+x
Rebuild the queue (S_IXOTH).