System Administration Guide: Advanced Administration

Examples—Creating a New Print Filter

The following example shows a print filter definition to convert N37 or Nlp to simple.


Input types: N37, Nlp, simple
Output types: simple
Command: /usr/bin/col
Options: MODES expand = -x
Options: INPUT simple = -p -f

In this example, the print filter program is named col. Once you add the new print filter to a print server, a user's print requests will be handled as follows:

The following example shows a print filter definition to convert from troff to PostScript.


Input types: troff
 
Output types: postscript
 
Printer types: PS
 
Filter type: slow
 
Command: /usr/lib/lp/postscript/dpost
 
Options: LENGTH * = -l*
 
Options: MODES port = -pp, MODES land = -pl
Options: MODES group \=\([1-9]\) = -n\l

In this example, the filter program is named dpost. It takes one input type, troff, produces a postscript output, and works with any printer of type PS (PostScript). Users need to give just the abbreviation port or land when they ask for the paper orientation to be in portrait mode or landscape mode. Because these options are not intrinsic to the LP print service, users must specify them using the lp -y command.

After you add the new print filter to a print server, print requests will be handled as follows: