]> git.ipfire.org Git - thirdparty/cups.git/blob - doc/help/man-filter.html
b4ca60975de9580f740276e34ce6e8fe7fcca89e
[thirdparty/cups.git] / doc / help / man-filter.html
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
2 <html>
3 <!-- SECTION: Man Pages -->
4 <head>
5 <link rel="stylesheet" type="text/css" href="../cups-printable.css">
6 <title>filter(7)</title>
7 </head>
8 <body>
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>
13 <b>filter
14 </b>job user title num-copies options [
15 <i>filename
16 </i>]
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
25 standard output.
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:
53 <dl>
54 <dt>ALERT: message
55 </dt>
56 <dd></dd>
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.
59 </dd>
60 <dt>ATTR: attribute=value [attribute=value]
61 </dt>
62 <dd></dd>
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".
68 </dd>
69 <dt>CRIT: message
70 </dt>
71 <dd></dd>
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.
74 </dd>
75 <dt>DEBUG: message
76 </dt>
77 <dd></dd>
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.
80 </dd>
81 <dt>DEBUG2: message
82 </dt>
83 <dd></dd>
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.
86 </dd>
87 <dt>EMERG: message
88 </dt>
89 <dd></dd>
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.
92 </dd>
93 <dt>ERROR: message
94 </dt>
95 <dd></dd>
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.
98 </dd>
99 <dt>INFO: message
100 </dt>
101 <dd></dd>
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.
105 </dd>
106 <dt>NOTICE: message
107 </dt>
108 <dd></dd>
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.
111 </dd>
112 <dt>PAGE: page-number #-copies
113 </dt>
114 <dd></dd>
115 <dt>PAGE: total #-pages
116 </dt>
117 <dd></dd>
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.
121 </dd>
122 <dt>PPD: Keyword=Value ... KeywordN=Value
123 </dt>
124 <dd></dd>
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.
128 </dd>
129 <dt>STATE: printer-state-reason [printer-state-reason ...]
130 </dt>
131 <dd></dd>
132 <dt>STATE: + printer-state-reason [printer-state-reason ...]
133 </dt>
134 <dd></dd>
135 <dt>STATE: - printer-state-reason [printer-state-reason ...]
136 </dt>
137 <dd></dd>
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.
141 </dd>
142 <dt>WARNING: message
143 </dt>
144 <dd></dd>
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.
147 </dd>
148 </dl>
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:
152 <dl>
153 <dt>CHARSET
154 </dt>
155 <dd></dd>
156 <dd>The default text character set, typically utf-8.
157 </dd>
158 <dt>CLASS
159 </dt>
160 <dd></dd>
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.
164 </dd>
165 <dt>CONTENT_TYPE
166 </dt>
167 <dd></dd>
168 <dd>The MIME type associated with the file (e.g.
169 application/postscript).
170 </dd>
171 <dt>CUPS_CACHEDIR
172 </dt>
173 <dd></dd>
174 <dd>The directory for semi-persistent cache files can be found.
175 </dd>
176 <dt>CUPS_DATADIR
177 </dt>
178 <dd></dd>
179 <dd>The directory where data files can be found.
180 </dd>
181 <dt>CUPS_FILETYPE
182 </dt>
183 <dd></dd>
184 <dd>The type of file being printed: "job-sheet" for a banner page and "document"
185 for a regular print file.
186 </dd>
187 <dt>CUPS_MAX_MESSAGE
188 </dt>
189 <dd></dd>
190 <dd>The maximum size of a message sent to stderr, including any leading prefix and
191 the trailing newline.
192 </dd>
193 <dt>CUPS_SERVERROOT
194 </dt>
195 <dd></dd>
196 <dd>The root directory of the server.
197 </dd>
198 <dt>DEVICE_URI
199 </dt>
200 <dd></dd>
201 <dd>The device-uri associated with the printer.
202 </dd>
203 <dt>FINAL_CONTENT_TYPE
204 </dt>
205 <dd></dd>
206 <dd>The MIME type associated with the printer (e.g.
207 application/vnd.cups-postscript).
208 </dd>
209 <dt>LANG
210 </dt>
211 <dd></dd>
212 <dd>The default language locale (typically C or en).
213 </dd>
214 <dt>PATH
215 </dt>
216 <dd></dd>
217 <dd>The standard execution path for external programs that may be run by
218 the filter.
219 </dd>
220 <dt>PPD
221 </dt>
222 <dd></dd>
223 <dd>The full pathname of the PostScript Printer Description (PPD)
224 file for this printer.
225 </dd>
226 <dt>PRINTER
227 </dt>
228 <dd></dd>
229 <dd>The name of the printer.
230 </dd>
231 <dt>RIP_CACHE
232 </dt>
233 <dd></dd>
234 <dd>The recommended amount of memory to use for Raster Image
235 Processors (RIPs).
236 </dd>
237 <dt>SOFTWARE
238 </dt>
239 <dd></dd>
240 <dd>The name and version number of the server (typically CUPS/1.2).
241 </dd>
242 <dt>TZ
243 </dt>
244 <dd></dd>
245 <dd>The timezone of the server.
246 </dd>
247 <dt>USER
248 </dt>
249 <dd></dd>
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.
252 </dd>
253 </dl>
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>,
261 <br>
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.
265
266 </body>
267 </html>