<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd"> <html> <!-- SECTION: Man Pages --> <head> <style type='text/css'><!-- h1, h2, h3, p { font-family: sans-serif; text-align: justify; } tt, pre a:link, pre a:visited, tt a:link, tt a:visited { font-weight: bold; color: #7f0000; } pre { font-weight: bold; color: #7f0000; margin-left: 2em; } h1.title, h2.title, h3.title { border-bottom: solid 2px #000000; } --></style> <title>filter(7)</title> </head> <body> <h2><a name='NAME'>Name</a></h2> filter - cups file conversion filter interface <h2><a name='SYNOPSIS'>Synopsis</a></h2> <b>filter </b>job user title num-copies options [ <i>filename </i>] <h2><a name='DESCRIPTION'>Description</a></h2> The CUPS filter interface provides a standard method for adding support for new document types to CUPS. Each filter is capable of converting from one or more input formats to another format that can either be printed directly or piped into another filter to get it to a printable format. <p>Filters <b>must</b> be capable of reading from a filename on the command-line or from the standard input, copying the standard input to a temporary file as required by the file format. All output <b>must</b> be sent to the standard output. <p>The command name (argv[0]) is set to the name of the destination printer. <h2><a name='LOG_MESSAGES'>Log Messages</a></h2> Messages sent to stderr are generally logged to printer-state-message attribute and the current <i>ErrorLog</i>. Each line begins with a standard prefix: <dl> <dt>ALERT: message </dt> <dd>Sets the printer-state-message attribute and adds the specified message to the current <i>ErrorLog</i> using the "alert" log level. </dd> <dt>ATTR: attribute=value [attribute=value] </dt> <dd>Sets the named job attribute(s). Typically this will be used to set the job-remote-id attribute. </dd> <dt>CRIT: message </dt> <dd>Sets the printer-state-message attribute and adds the specified message to the current <i>ErrorLog</i> using the "critical" log level. </dd> <dt>DEBUG: message </dt> <dd>Sets the printer-state-message attribute and adds the specified message to the current <i>ErrorLog</i> using the "debug" log level. </dd> <dt>DEBUG2: message </dt> <dd>Sets the printer-state-message attribute and adds the specified message to the current <i>ErrorLog</i> using the "debug2" log level. </dd> <dt>EMERG: message </dt> <dd>Sets the printer-state-message attribute and adds the specified message to the current <i>ErrorLog</i> using the "emergency" log level. </dd> <dt>ERROR: message </dt> <dd>Sets the printer-state-message attribute and adds the specified message to the current <i>ErrorLog</i> using the "error" log level. </dd> <dt>INFO: message </dt> <dd>Sets the printer-state-message attribute. If the current <i>LogLevel</i> is set to "debug2", also adds the specified message to the current <i>ErrorLog</i> using the "info" log level. </dd> <dt>NOTICE: message </dt> <dd>Sets the printer-state-message attribute and adds the specified message to the current <i>ErrorLog</i> using the "notice" log level. </dd> <dt>PAGE: page-number #-copies </dt> <dt>PAGE: total #-pages </dt> <dd>Adds an entry to the current <i>PageLog</i>. The first form adds #-copies to the job-media-sheets-completed attribute. The second form sets the job-media-sheets-completed attribute to #-pages. </dd> <dt>STATE: printer-state-reason [printer-state-reason ...] </dt> <dt>STATE: + printer-state-reason [printer-state-reason ...] </dt> <dt>STATE: - printer-state-reason [printer-state-reason ...] </dt> <dd>Sets, adds, or removes printer-state-reason keywords to the current queue. Typically this is used to indicate media, ink, and toner conditions on a printer. </dd> <dt>WARNING: message </dt> <dd>Sets the printer-state-message attribute and adds the specified message to the current <i>ErrorLog</i> using the "warning" log level. </dd> </dl> <h2><a name='ENVIRONMENT_VARIABLES'>Environment Variables</a></h2> The following environment variables are defined by the CUPS server when executing the filter: <dl> <dt>CHARSET </dt> <dd>The default text character set, typically utf-8. </dd> <dt>CLASS </dt> <dd>When a job is submitted to a printer class, contains the name of the destination printer class. Otherwise this environment variable will not be set. </dd> <dt>CONTENT_TYPE </dt> <dd>The MIME type associated with the file (e.g. application/postscript). </dd> <dt>CUPS_DATADIR </dt> <dd>The directory where data files can be found. </dd> <dt>CUPS_SERVERROOT </dt> <dd>The root directory of the server. </dd> <dt>DEVICE_URI </dt> <dd>The device-uri associated with the printer. </dd> <dt>FINAL_CONTENT_TYPE </dt> <dd>The MIME type associated with the printer (e.g. application/vnd.cups-postscript). </dd> <dt>LANG </dt> <dd>The default language locale (typically C or en). </dd> <dt>PATH </dt> <dd>The standard execution path for external programs that may be run by the filter. </dd> <dt>PPD </dt> <dd>The full pathname of the PostScript Printer Description (PPD) file for this printer. </dd> <dt>PRINTER </dt> <dd>The name of the printer. </dd> <dt>RIP_CACHE </dt> <dd>The recommended amount of memory to use for Raster Image Processors (RIPs). </dd> <dt>SOFTWARE </dt> <dd>The name and version number of the server (typically CUPS/1.2). </dd> <dt>TZ </dt> <dd>The timezone of the server. </dd> <dt>USER </dt> <dd>The user executing the filter, typically "lp" or "root"; consult the <a href='man-cupsd.conf.html?TOPIC=Man+Pages'>cupsd.conf(5)</a> file for the current setting. </dd> </dl> <h2><a name='COMPATIBILITY'>Compatibility</a></h2> While the filter interface is compatible with System V interface scripts, it will only work with the System V interface script as the only filter. Typically the interface script will be provided via the <a href='man-lpadmin.html?TOPIC=Man+Pages'>lpadmin(8)</a> command using the <i>-i</i> option. <h2><a name='SEE_ALSO'>See Also</a></h2> <a href='man-backend.html?TOPIC=Man+Pages'>backend(1)</a>, <a href='man-cupsd.html?TOPIC=Man+Pages'>cupsd(8)</a>, <br> <a href='http://localhost:631/help'>http://localhost:631/help</a> <h2><a name='COPYRIGHT'>Copyright</a></h2> Copyright 2007 by Apple Inc. </body> </html>