Specifications

6-26
Guide to Printers and Printing
Example: col Filter
Suppose you already added a filter called col with the following definition:
Input types: N37, Nlp, simple
Output types: simple
Command: /usr/bin/col
Options: TERM 450 = –b, MODES expand = –x
Options: INPUT simple = –p –f
Note: If you provide more than one definition (that is, more than one line) for any filter
characteristic other than Options, only the last definition will be used by the print service.
After you have registered this definition with the print service by entering it as input with the
lpfilter command, users’ print requests will be handled as follows:
If a user enters the command
lp –y expand report.dec10
the filter command will run with the following arguments:
/usr/bin/col –x –p –f
If a user enters the command
lp –T N37 –y expand report.dec10
the filter command will run with the following arguments:
/usr/bin/col –x
Qualifier: The default printer is not of type 450.
If a user enters the command
lp –y expand –T 450 report.dec10
the filter command will be run with the following arguments:
/usr/bin/col –b –x
Example: dpost Filter
The filter program is called /usr/lib/lp/postscript/dpost. It takes one input type, troff, produces
an output type called postscript and works with any printer of type PS (for PostScript).
You have decided that your users need give just the abbreviations port and land when they
ask for the paper orientation to be portrait mode and landscape mode, respectively.
Because these options are not intrinsic to the print service, users must specify them using
the –y option to the lp command.
The filter definition would look like this:
Input types: troff
Output types: postscript
Printer types: PS
Filter type: slow
Command: /usr/lib/lp/postscript/dpost
Options: LENGTH * = –l*
Options: MODES portrait = –op, MODES land = –ol
A user submitting a file of type troff for printing on a PostScript printer (type PS), with
requests for landscape orientation and a page length of 60 lines, would enter the following
command:
lp –T troff –o length=60 –y land –d any
This filter would be invoked by the print service to convert the file as follows:
/usr/lib/lp/postscript/dpost –l60 –ol –pl
Example: Option Template
You add the following option template to the previous example:
Options: MODES group\=\([1–9]\) = –n\l