1 <!DOCTYPE HTML PUBLIC
"-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
3 <!-- SECTION: Man Pages -->
5 <link rel=
"stylesheet" type=
"text/css" href=
"../cups-printable.css">
6 <title>filter(
7)
</title>
9 <h1 class=
"title">filter(
7)
</h1>
10 <h2 class=
"title"><a name=
"NAME">Name
</a></h2>
11 filter - cups file conversion filter interface
12 <h2 class=
"title"><a name=
"SYNOPSIS">Synopsis
</a></h2>
14 </b>job user title num-copies options [
17 <h2 class=
"title"><a name=
"DESCRIPTION">Description
</a></h2>
18 The CUPS filter interface provides a standard method for adding support for
19 new document types to CUPS. Each filter is capable of converting from one
20 or more input formats to another format that can either be printed directly
21 or piped into another filter to get it to a printable format.
22 <p>Filters
<b>must
</b> be capable of reading from a filename on the command-line
23 or from the standard input, copying the standard input to a temporary
24 file as required by the file format. All output
<b>must
</b> be sent to the
26 <p>The command name (argv[
0]) is set to the name of the destination printer but is
27 also available in the PRINTER environment variable.
28 <h2 class=
"title"><a name=
"WARNING">Warning
</a></h2>
29 CUPS filters are not meant to be run directly by the user. Aside from the legacy
30 System V interface issues (argv[
0] is the printer name), CUPS filters also
31 expect specific environment variables and file descriptors, and typically run in
32 a user session that (on OS X) has additional restrictions that affect how it
33 runs. Unless you are a developer and know what you are doing, please do not run
34 filters directly. Instead, use the
<a href='man-cupsfilter.html?TOPIC=Man+Pages'
>cupsfilter(
8)
</a> program to use the
35 appropriate filters to do the conversions you need.
36 <h2 class=
"title"><a name=
"OPTIONS">Options
</a></h2>
37 Options passed on the command-line typically do not include the default choices
38 the printer's PPD file. In addition, some options may be specified in multiple
39 ways -
"landscape" is a synonym for
"orientation-requested=4",
"media" is a
40 synonym for
"PageSize",
"PageRegion",
"InputSlot", and
"MediaType", and
"sides"
41 is a synonym for the various
"Duplex" options. Non-raster filters
<b>must
</b>
42 support both explicit and implicit specification of PPD options - use the
43 ppdMarkDefaults and cupsMarkOptions functions in the CUPS library to use the
44 correct mapping, and ppdFindMarkedChoice to get the user-selected choice.
45 <p>Raster filters should use option choices set through the raster page header, as
46 those reflect the options in effect for a given page. Options specified on the
47 command-line determine the default values for the entire job, which can be
48 overridden on a per-page basis.
49 <h2 class=
"title"><a name=
"LOG_MESSAGES">Log Messages
</a></h2>
50 Messages sent to stderr are generally logged to
51 printer-state-message attribute and the current
<i>ErrorLog
</i>.
52 Each line begins with a standard prefix:
57 <dd>Sets the printer-state-message attribute and adds the specified
58 message to the current
<i>ErrorLog
</i> using the
"alert" log level.
60 <dt>ATTR: attribute=value [attribute=value]
63 <dd>Sets the named job or printer attribute(s). The following job attributes can be
64 set:
"job-media-progress". The following printer attributes can be set:
65 "auth-info-required",
"marker-colors",
"marker-high-levels",
"marker-levels",
66 "marker-low-levels",
"marker-message",
"marker-names",
"marker-types",
67 "printer-alert", and
"printer-alert-description".
72 <dd>Sets the printer-state-message attribute and adds the specified
73 message to the current
<i>ErrorLog
</i> using the
"critical" log level.
78 <dd>Sets the printer-state-message attribute and adds the specified
79 message to the current
<i>ErrorLog
</i> using the
"debug" log level.
84 <dd>Sets the printer-state-message attribute and adds the specified
85 message to the current
<i>ErrorLog
</i> using the
"debug2" log level.
90 <dd>Sets the printer-state-message attribute and adds the specified
91 message to the current
<i>ErrorLog
</i> using the
"emergency" log level.
96 <dd>Sets the printer-state-message attribute and adds the specified
97 message to the current
<i>ErrorLog
</i> using the
"error" log level.
102 <dd>Sets the printer-state-message attribute. If the current
<i>LogLevel
</i>
103 is set to
"debug2", also adds the specified message to the
104 current
<i>ErrorLog
</i> using the
"info" log level.
109 <dd>Sets the printer-state-message attribute and adds the specified
110 message to the current
<i>ErrorLog
</i> using the
"notice" log level.
112 <dt>PAGE: page-number #-copies
115 <dt>PAGE: total #-pages
118 <dd>Adds an entry to the current
<i>PageLog
</i>. The first form adds
119 #-copies to the job-media-sheets-completed attribute. The second
120 form sets the job-media-sheets-completed attribute to #-pages.
122 <dt>PPD: Keyword=Value ... KeywordN=Value
125 <dd>Sets the named keywords in the printer's PPD file. This is typically
126 used to update default option keywords such as DefaultPageSize and
127 the various installable options in the PPD file.
129 <dt>STATE: printer-state-reason [printer-state-reason ...]
132 <dt>STATE: + printer-state-reason [printer-state-reason ...]
135 <dt>STATE: - printer-state-reason [printer-state-reason ...]
138 <dd>Sets, adds, or removes printer-state-reason keywords to the
139 current queue. Typically this is used to indicate media, ink, and
140 toner conditions on a printer.
145 <dd>Sets the printer-state-message attribute and adds the specified
146 message to the current
<i>ErrorLog
</i> using the
"warning" log level.
149 <h2 class=
"title"><a name=
"ENVIRONMENT_VARIABLES">Environment Variables
</a></h2>
150 The following environment variables are defined by the CUPS
151 server when executing the filter:
156 <dd>The default text character set, typically utf-
8.
161 <dd>When a job is submitted to a printer class, contains the name of
162 the destination printer class. Otherwise this environment
163 variable will not be set.
168 <dd>The MIME type associated with the file (e.g.
169 application/postscript).
174 <dd>The directory for semi-persistent cache files can be found.
179 <dd>The directory where data files can be found.
184 <dd>The type of file being printed:
"job-sheet" for a banner page and
"document"
185 for a regular print file.
190 <dd>The maximum size of a message sent to stderr, including any leading prefix and
191 the trailing newline.
196 <dd>The root directory of the server.
201 <dd>The device-uri associated with the printer.
203 <dt>FINAL_CONTENT_TYPE
206 <dd>The MIME type associated with the printer (e.g.
207 application/vnd.cups-postscript).
212 <dd>The default language locale (typically C or en).
217 <dd>The standard execution path for external programs that may be run by
223 <dd>The full pathname of the PostScript Printer Description (PPD)
224 file for this printer.
229 <dd>The name of the printer.
234 <dd>The recommended amount of memory to use for Raster Image
240 <dd>The name and version number of the server (typically CUPS/
1.2).
245 <dd>The timezone of the server.
250 <dd>The user executing the filter, typically
"lp" or
"root"; consult the
251 <a href='man-cupsd.conf.html?TOPIC=Man+Pages'
>cupsd.conf(
5)
</a> file for the current setting.
254 <h2 class=
"title"><a name=
"COMPATIBILITY">Compatibility
</a></h2>
255 While the filter interface is compatible with System V interface
256 scripts, it will only work with the System V interface script as the
257 only filter. Typically the interface script will be provided via the
258 <a href='man-lpadmin.html?TOPIC=Man+Pages'
>lpadmin(
8)
</a> command using the
<i>-i
</i> option.
259 <h2 class=
"title"><a name=
"SEE_ALSO">See Also
</a></h2>
260 <a href='man-backend.html?TOPIC=Man+Pages'
>backend(
7)
</a>,
<a href='man-cupsd.html?TOPIC=Man+Pages'
>cupsd(
8)
</a>,
<a href='man-cupsfilter.html?TOPIC=Man+Pages'
>cupsfilter(
8)
</a>,
262 <a href='http://localhost:
631/help'
>http://localhost:
631/help
</a>
263 <h2 class=
"title"><a name=
"COPYRIGHT">Copyright
</a></h2>
264 Copyright
2007-
2013 by Apple Inc.