Specifications
6-24
Guide to Printers and Printing
replace any asterisks it contains with the pattern specified or expand any regular
expressions it contains, and append the result to the command line.”
The options specified in a filter definition may include none, all, or any subset of these 13
keywords. In addition, a single keyword may be defined more than once, if multiple
definitions are required for a complete filter definition. See Using Templates to Defining
Options on page 6-24.
When you have gathered enough information to define the characteristics of your filter, you
are ready to run the lpfilter command, using your data as arguments. Because there are so
many arguments and because some of them may need to be entered more than once (with
different values), record this information first in a separate file and edit it, if necessary. You
can then use the file as input to the lpfilter command and avoid entering each piece of
information separately.
Using Templates to Defining Options
A template is a statement in a filter definition that defines an option to be passed to the filter
command based on the value of one of the characteristics of the filter. A filter definition may
include more than one template. Multiple templates may be entered on a single line and
separated with commas, or they may be entered on separate lines, preceded by the
Options: prefix.
The format of a template is as follows:
keyword pattern = replacement
This type of statement is interpreted by the print service to mean: ”When the information
referred to by keyword has the value matched by pattern, take the replacement string,
replace any asterisks it contains with the pattern specified or expand any regular
expressions it contains, and append the result to the command line.”
As an example, suppose you want to have the print service scheduler assign print requests
to filters on the basis of the following criteria:
• If the type of OUTPUT to be produced by the filter is impress, then pass the –I option to
the filter.
• If the type of OUTPUT to be produced by the filter is postscript, then pass the –P option
to the filter.
To specify these criteria, provide the following templates as options to the lpfilter command:
Options: OUTPUT impress=–I, OUTPUT postscript=–P
If the Options: line becomes too long, put each template on a separate line, as follows:
”Options: OUTPUT impress=–I”
”Options: OUTPUT postscript=–P”
In both templates, the keyword is OUTPUT. In the first template, the value of pattern is
impress and the value of the replacement is –I. In the second template, the value of pattern
is postscript and the value of the replacement is –P.
Keyword Definitions and Examples
The following keywords are available for defining Options in a filter definition:
Characteristic
keyword Possible pattern s Example
Content type (input) INPUT content–type troff
Content type (output) OUTPUT content–type postscript
Printer type TERM printer–type att495
Printer name PRINTE
R
printer–name lp1
Character pitch CPI scaled–decimal 10