2 .\" "$Id: filter.man 7600 2008-05-20 21:06:23Z mike $"
4 .\" filter man page for CUPS.
6 .\" Copyright 2007-2012 by Apple Inc.
7 .\" Copyright 1997-2007 by Easy Software Products.
9 .\" These coded instructions, statements, and computer programs are the
10 .\" property of Apple Inc. and are protected by Federal copyright
11 .\" law. Distribution and use rights are outlined in the file "LICENSE.txt"
12 .\" which should have been included with this file. If this file is
13 .\" file is missing or damaged, see the license at "http://www.cups.org/".
15 .TH filter 7 "CUPS" "18 May 2012" "Apple Inc."
17 filter \- cups file conversion filter interface
20 job user title num-copies options [
24 The CUPS filter interface provides a standard method for adding support for
25 new document types to CUPS. Each filter is capable of converting from one
26 or more input formats to another format that can either be printed directly
27 or piped into another filter to get it to a printable format.
29 Filters \fBmust\fR be capable of reading from a filename on the command-line
30 or from the standard input, copying the standard input to a temporary
31 file as required by the file format. All output \fBmust\fR be sent to the
34 The command name (argv[0]) is set to the name of the destination printer but is
35 also available in the PRINTER environment variable.
37 CUPS filters are not meant to be run directly by the user. Aside from the legacy
38 System V interface issues (argv[0] is the printer name), CUPS filters also
39 expect specific environment variables and file descriptors, and typically run in
40 a user session that (on OS X) has additional restrictions that affect how it
41 runs. Unless you are a developer and know what you are doing, please do not run
42 filters directly. Instead, use the \fIcupsfilter(8)\fR program to use the
43 appropriate filters to do the conversions you need.
45 Options passed on the command-line typically do not include the default choices
46 the printer's PPD file. In addition, some options may be specified in multiple
47 ways - "landscape" is a synonym for "orientation-requested=4", "media" is a
48 synonym for "PageSize", "PageRegion", "InputSlot", and "MediaType", and "sides"
49 is a synonym for the various "Duplex" options. Non-raster filters \fBmust\fR
50 support both explicit and implicit specification of PPD options - use the
51 ppdMarkDefaults and cupsMarkOptions functions in the CUPS library to use the
52 correct mapping, and ppdFindMarkedChoice to get the user-selected choice.
54 Raster filters should use option choices set through the raster page header, as
55 those reflect the options in effect for a given page. Options specified on the
56 command-line determine the default values for the entire job, which can be
57 overridden on a per-page basis.
59 Messages sent to stderr are generally logged to
60 printer-state-message attribute and the current \fIErrorLog\fR.
61 Each line begins with a standard prefix:
65 Sets the printer-state-message attribute and adds the specified
66 message to the current \fIErrorLog\fR using the "alert" log level.
68 ATTR: attribute=value [attribute=value]
70 Sets the named job or printer attribute(s). The following job attributes can be
71 set: "job-media-progress". The following printer attributes can be set:
72 "auth-info-required", "marker-colors", "marker-high-levels", "marker-levels",
73 "marker-low-levels", "marker-message", "marker-names", "marker-types",
74 "printer-alert", and "printer-alert-description".
78 Sets the printer-state-message attribute and adds the specified
79 message to the current \fIErrorLog\fR using the "critical" log level.
83 Sets the printer-state-message attribute and adds the specified
84 message to the current \fIErrorLog\fR using the "debug" log level.
88 Sets the printer-state-message attribute and adds the specified
89 message to the current \fIErrorLog\fR using the "debug2" log level.
93 Sets the printer-state-message attribute and adds the specified
94 message to the current \fIErrorLog\fR using the "emergency" log level.
98 Sets the printer-state-message attribute and adds the specified
99 message to the current \fIErrorLog\fR using the "error" log level.
103 Sets the printer-state-message attribute. If the current \fILogLevel\fR
104 is set to "debug2", also adds the specified message to the
105 current \fIErrorLog\fR using the "info" log level.
109 Sets the printer-state-message attribute and adds the specified
110 message to the current \fIErrorLog\fR using the "notice" log level.
112 PAGE: page-number #-copies
116 Adds an entry to the current \fIPageLog\fR. The first form adds
117 #-copies to the job-media-sheets-completed attribute. The second
118 form sets the job-media-sheets-completed attribute to #-pages.
120 PPD: Keyword=Value ... KeywordN=Value
122 Sets the named keywords in the printer's PPD file. This is typically
123 used to update default option keywords such as DefaultPageSize and
124 the various installable options in the PPD file.
126 STATE: printer-state-reason [printer-state-reason ...]
128 STATE: + printer-state-reason [printer-state-reason ...]
130 STATE: - printer-state-reason [printer-state-reason ...]
132 Sets, adds, or removes printer-state-reason keywords to the
133 current queue. Typically this is used to indicate media, ink, and
134 toner conditions on a printer.
138 Sets the printer-state-message attribute and adds the specified
139 message to the current \fIErrorLog\fR using the "warning" log level.
140 .SH ENVIRONMENT VARIABLES
141 The following environment variables are defined by the CUPS
142 server when executing the filter:
146 The default text character set, typically utf-8.
150 When a job is submitted to a printer class, contains the name of
151 the destination printer class. Otherwise this environment
152 variable will not be set.
156 The MIME type associated with the file (e.g.
157 application/postscript).
161 The directory for semi-persistent cache files can be found.
165 The directory where data files can be found.
169 The type of file being printed: "job-sheet" for a banner page and "document"
170 for a regular print file.
174 The maximum size of a message sent to stderr, including any leading prefix and
175 the trailing newline.
179 The root directory of the server.
183 The device-uri associated with the printer.
187 The MIME type associated with the printer (e.g.
188 application/vnd.cups-postscript).
192 The default language locale (typically C or en).
196 The standard execution path for external programs that may be run by
201 The full pathname of the PostScript Printer Description (PPD)
202 file for this printer.
206 The name of the printer.
210 The recommended amount of memory to use for Raster Image
215 The name and version number of the server (typically CUPS/1.2).
219 The timezone of the server.
223 The user executing the filter, typically "lp" or "root"; consult the
224 \fIcupsd.conf(5)\fR file for the current setting.
226 While the filter interface is compatible with System V interface
227 scripts, it will only work with the System V interface script as the
228 only filter. Typically the interface script will be provided via the
229 \fIlpadmin(8)\fR command using the \fI-i\fR option.
231 \fIbackend(7)\fR, \fIcupsd(8)\fR, \fIcupsfilter(8)\fR,
233 http://localhost:631/help
235 Copyright 2007-2012 by Apple Inc.
237 .\" End of "$Id: filter.man 7600 2008-05-20 21:06:23Z mike $".