CHANGES IN CUPS V1.3.11
+ - The pdftops filter did not print landscape PDF pages properly
+ (STR #2881)
- The scheduler did not handle partial header lines properly from CGI
programs (STR #3194)
- The web interface could hang on OpenBSD (STR #3176, STR #3196)
-CHANGES.txt - 2009-05-16
+CHANGES.txt - 2009-05-22
------------------------
+CHANGES IN CUPS V1.4rc1
+
+ - The PPD compiler now defines six variables: CUPS_VERSION,
+ CUPS_VERSION_MAJOR, CUPS_VERSION_MINOR, CUPS_VERSION_PATCH,
+ PLATFORM_NAME, and PLATFORM_ARCH (STR #3203)
+ - Fixed a whitespace skipping bug in cupsRasterInterpretPPD.
+ - The scheduler did not return HTTP 403 (Forbidden) for authenticated
+ users that were not authorized to do IPP operations (STR #3193)
+ - The scheduler did not report more than 8 Product strings from a PPD
+ file. Some PPD files have as many as 24.
+ - ppdOpen*() could crash if a keyword had no value string (something
+ that cupstestppd looks for...)
+ - cupsLangDefault() did not return the correct language on Mac OS X.
+ - The Mac OS X USB backend did not handle aborted or stalled pipe
+ conditions properly, which prevented drivers from ejecting partial
+ pages when a job was canceled or held.
+
+
CHANGES IN CUPS V1.4b3
- Documentation fixes (STR #3044, STR #3057, STR #3153, STR #3158,
-INSTALL - CUPS v1.4b3 - 2009-04-20
-----------------------------------
+INSTALL - CUPS v1.4rc1 - 2009-05-22
+-----------------------------------
This file describes how to compile and install CUPS from source code. For more
information on CUPS see the file called "README.txt". A complete change log can
-README - CUPS v1.4b3 - 2009-03-09
----------------------------------
-
-**********************************************************************
-**********************************************************************
-********** **********
-********** THIS IS BETA-RELEASE SOFTWARE. DO NOT USE ON **********
-********** PRODUCTION SYSTEMS! REPORT PROBLEMS TO THE **********
-********** CUPS FORUMS OR BUG REPORTING PAGES: **********
-********** **********
-********** http://www.cups.org/newsgroups.php (FORUMS) **********
-********** http://www.cups.org/str.php (BUGS) **********
-********** **********
-**********************************************************************
-**********************************************************************
+README - CUPS v1.4rc1 - 2009-05-22
+----------------------------------
Looking for compile instructions? Read the file "INSTALL.txt"
instead...
INTRODUCTION
- The Common UNIX Printing System ("CUPS") is a standards-based, open source
- printing system developed by Apple Inc. for Mac OS® X and other UNIX®-like
- operating systems. CUPS uses the Internet Printing Protocol ("IPP") and
- provides System V and Berkeley command-line interfaces, a web interface,
- and a C API to manage printers and print jobs. It supports printing to
- both local (parallel, serial, USB) and networked printers, and printers can
- be shared from one computer to another, even over the Internet!
+ CUPS is a standards-based, open source printing system developed by Apple
+ Inc. for Mac OS® X and other UNIX®-like operating systems. CUPS uses the
+ Internet Printing Protocol ("IPP") and provides System V and Berkeley
+ command-line interfaces, a web interface, and a C API to manage printers and
+ print jobs. It supports printing to both local (parallel, serial, USB) and
+ networked printers, and printers can be shared from one computer to another,
+ even over the Internet!
Internally, CUPS uses PostScript Printer Description ("PPD") files to
describe printer capabilities and features and a wide variety of generic
*/
if (iostatus == kIOUSBTransactionTimeout)
+ {
+ fputs("DEBUG: Got USB transaction timeout during write!\n", stderr);
iostatus = 0;
+ }
/*
- * Ignore stall errors, since we clear any stalls in the class driver...
+ * Ignore the first stall error we get since we try to clear any stalls
+ * in the class driver...
*/
- if (iostatus == kIOUSBPipeStalled)
- iostatus = 0;
+ else if (iostatus == kIOUSBPipeStalled)
+ {
+ fputs("DEBUG: Got USB pipe stalled during write!\n", stderr);
+
+ bytes = 0;
+
+ if (prev_iostatus != kIOUSBPipeStalled)
+ {
+ prev_iostatus = iostatus;
+ iostatus = 0;
+ }
+ }
/*
* Ignore the first "aborted" status we get, since we might have
* received a signal (<rdar://problem/6860126>)...
*/
- if (iostatus == kIOReturnAborted && prev_iostatus != kIOReturnAborted)
+ else if (iostatus == kIOReturnAborted)
{
- prev_iostatus = iostatus;
- iostatus = 0;
- }
+ fputs("DEBUG: Got return aborted during write!\n", stderr);
+
+ IOReturn err = (*g.classdriver)->Abort(g.classdriver);
+ fprintf(stderr, "DEBUG: USB class driver Abort returned %x\n", err);
+
+ bytes = 0;
+
+ if (prev_iostatus != kIOReturnAborted)
+ {
+ prev_iostatus = iostatus;
+ iostatus = 0;
+ }
+ }
else
- prev_iostatus = iostatus;
+ prev_iostatus = iostatus;
if (iostatus || bytes < 0)
{
* Write error - bail if we don't see an error we can retry...
*/
- IOReturn err = (*g.classdriver)->Abort(g.classdriver);
_cupsLangPuts(stderr, _("ERROR: Unable to send print data!\n"));
fprintf(stderr, "DEBUG: USB class driver WritePipe returned %x\n",
iostatus);
+
+ IOReturn err = (*g.classdriver)->Abort(g.classdriver);
fprintf(stderr, "DEBUG: USB class driver Abort returned %x\n",
err);
+
status = job_canceled ? CUPS_BACKEND_FAILED : CUPS_BACKEND_STOP;
break;
}
+ else if (bytes > 0)
+ {
+ fprintf(stderr, "DEBUG: Wrote %d bytes of print data...\n", (int)bytes);
- fprintf(stderr, "DEBUG: Wrote %d bytes of print data...\n", (int)bytes);
-
- g.print_bytes -= bytes;
- print_ptr += bytes;
- total_bytes += bytes;
+ g.print_bytes -= bytes;
+ print_ptr += bytes;
+ total_bytes += bytes;
+ }
}
if (print_fd != 0 && status == noErr)
readstatus = (*g.classdriver)->ReadPipe(g.classdriver, readbuffer, &rbytes);
if (readstatus == kIOReturnSuccess && rbytes > 0)
{
+ fprintf(stderr, "DEBUG: Read %d bytes of back-channel data...\n",
+ (int)rbytes);
cupsBackChannelWrite((char*)readbuffer, rbytes, 1.0);
/* cntrl-d is echoed by the printer.
parse_pserror(readbuffer, rbytes);
#endif
}
+ else if (readstatus == kIOUSBTransactionTimeout)
+ fputs("DEBUG: Got USB transaction timeout during write!\n", stderr);
+ else if (readstatus == kIOUSBPipeStalled)
+ fputs("DEBUG: Got USB pipe stalled during read!\n", stderr);
+ else if (readstatus == kIOReturnAborted)
+ fputs("DEBUG: Got return aborted during read!\n", stderr);
/*
* Make sure this loop executes no more than once every 250 miliseconds...
switch (command)
{
case CUPS_SC_CMD_SOFT_RESET: /* Do a soft reset */
+ fputs("DEBUG: CUPS_SC_CMD_SOFT_RESET received from driver...\n",
+ stderr);
+
if ((*g.classdriver)->SoftReset != NULL)
{
soft_reset();
cupsSideChannelWrite(command, CUPS_SC_STATUS_OK, NULL, 0, 1.0);
+ fputs("DEBUG: Returning status CUPS_STATUS_OK with no bytes...\n",
+ stderr);
}
else
{
cupsSideChannelWrite(command, CUPS_SC_STATUS_NOT_IMPLEMENTED,
NULL, 0, 1.0);
+ fputs("DEBUG: Returning status CUPS_STATUS_NOT_IMPLEMENTED with "
+ "no bytes...\n", stderr);
}
break;
case CUPS_SC_CMD_DRAIN_OUTPUT: /* Drain all pending output */
+ fputs("DEBUG: CUPS_SC_CMD_DRAIN_OUTPUT received from driver...\n",
+ stderr);
+
g.drain_output = 1;
break;
case CUPS_SC_CMD_GET_BIDI: /* Is the connection bidirectional? */
+ fputs("DEBUG: CUPS_SC_CMD_GET_BIDI received from driver...\n",
+ stderr);
+
data[0] = g.bidi_flag;
cupsSideChannelWrite(command, CUPS_SC_STATUS_OK, data, 1, 1.0);
+
+ fprintf(stderr,
+ "DEBUG: Returned CUPS_SC_STATUS_OK with 1 byte (%02X)...\n",
+ data[0]);
break;
case CUPS_SC_CMD_GET_DEVICE_ID: /* Return IEEE-1284 device ID */
+ fputs("DEBUG: CUPS_SC_CMD_GET_DEVICE_ID received from driver...\n",
+ stderr);
+
datalen = sizeof(data);
get_device_id(&status, data, &datalen);
cupsSideChannelWrite(command, CUPS_SC_STATUS_OK, data, datalen, 1.0);
+
+ if (datalen < sizeof(data))
+ data[datalen] = '\0';
+ else
+ data[sizeof(data) - 1] = '\0';
+
+ fprintf(stderr,
+ "DEBUG: Returning CUPS_SC_STATUS_OK with %d bytes (%s)...\n",
+ datalen, data);
break;
case CUPS_SC_CMD_GET_STATE: /* Return device state */
+ fputs("DEBUG: CUPS_SC_CMD_GET_STATE received from driver...\n",
+ stderr);
+
data[0] = CUPS_SC_STATE_ONLINE;
cupsSideChannelWrite(command, CUPS_SC_STATUS_OK, data, 1, 1.0);
+
+ fprintf(stderr,
+ "DEBUG: Returned CUPS_SC_STATUS_OK with 1 byte (%02X)...\n",
+ data[0]);
break;
default:
+ fprintf(stderr, "DEBUG: Unknown side-channel command (%d) received "
+ "from driver...\n", command);
+
cupsSideChannelWrite(command, CUPS_SC_STATUS_NOT_IMPLEMENTED,
NULL, 0, 1.0);
+
+ fputs("DEBUG: Returned CUPS_SC_STATUS_NOT_IMPLEMENTED with no bytes...\n",
+ stderr);
break;
}
}
if (stat(bundlestr, &bundleinfo))
{
- fprintf(stderr, "Unable to load class driver \"%s\": %s", bundlestr,
- strerror(errno));
+ fprintf(stderr, "DEBUG: Unable to load class driver \"%s\": %s\n",
+ bundlestr, strerror(errno));
return (kr);
}
else if (bundleinfo.st_mode & S_IWOTH)
{
- fprintf(stderr, "Unable to load class driver \"%s\": insecure file "
- "permissions (0%o)", bundlestr, bundleinfo.st_mode);
+ fprintf(stderr, "DEBUG: Unable to load class driver \"%s\": insecure file "
+ "permissions (0%o)\n", bundlestr, bundleinfo.st_mode);
return (kr);
}
*
* Web search program for www.cups.org.
*
- * Copyright 2007-2008 by Apple Inc.
+ * Copyright 2007-2009 by Apple Inc.
* Copyright 1997-2007 by Easy Software Products.
*
* These coded instructions, statements, and computer programs are the
* Local functions...
*/
-static void list_nodes(const char *title, cups_array_t *nodes);
+static void list_nodes(help_index_t *hi, const char *title,
+ cups_array_t *nodes);
/*
search = helpSearchIndex(hi, argv[2], NULL, NULL);
if (search)
- list_nodes(argv[1], search->sorted);
+ list_nodes(hi, argv[1], search->sorted);
/*
* Return with no errors...
*/
static void
-list_nodes(const char *title, /* I - Title string */
+list_nodes(help_index_t *hi, /* I - Help index */
+ const char *title, /* I - Title string */
cups_array_t *nodes) /* I - Nodes */
{
- help_node_t *node; /* Current node */
+ help_node_t *node, /* Current node */
+ *file; /* File node */
printf("%d\n", cupsArrayCount(nodes));
node = (help_node_t *)cupsArrayNext(nodes))
{
if (node->anchor)
- printf("%d|%s#%s|%s\n", node->score, node->filename, node->anchor,
- node->text);
+ {
+ file = helpFindNode(hi, node->filename, NULL);
+ printf("%d|%s#%s|%s|%s\n", node->score, node->filename, node->anchor,
+ node->text, file ? file->text : node->filename);
+ }
else
- printf("%d|%s|%s\n", node->score, node->filename, node->text);
+ printf("%d|%s|%s|%s\n", node->score, node->filename, node->text,
+ node->text);
}
}
#
# MIME converts file for the Common UNIX Printing System (CUPS).
#
-# Copyright 2007-2008 by Apple Inc.
+# Copyright 2007-2009 by Apple Inc.
# Copyright 1997-2007 by Easy Software Products.
#
# These coded instructions, statements, and computer programs are the
# PostScript filters
#
-application/pdf application/postscript 33 pdftops
+application/pdf application/vnd.cups-postscript 66 pdftops
application/postscript application/vnd.cups-postscript 66 pstops
application/vnd.hp-HPGL application/postscript 66 hpgltops
application/x-cshell application/postscript 33 texttops
AC_CONFIG_HEADER(config.h)
dnl Version number information...
-CUPS_VERSION="1.4b3"
+CUPS_VERSION="1.4rc1"
CUPS_REVISION=""
#if test -z "$CUPS_REVISION" -a -d .svn; then
# CUPS_REVISION="-r`svnversion . | awk -F: '{print $NF}' | sed -e '1,$s/[[a-zA-Z]]*//g'`"
Programming: <a href='api-cups.html' target='_top'>CUPS API</a><br>
Programming: <a href='api-ppd.html' target='_top'>PPD API</a><br>
Programming: <a href='api-raster.html' target='_top'>Raster API</a><br>
+ Programming: <a href='postscript-driver.html' target='_top'>Developing PostScript Printer Drivers</a><br>
+ Programming: <a href='raster-driver.html' target='_top'>Developing Raster Printer Drivers</a><br>
Specifications: <a href='spec-design' target='_top'>CUPS Design Description</a></td>
</tr>
</tbody>
cups_option_t **options) /* IO - Additional selected options */
{
int i, /* Looping var */
+ tries, /* Number of tries */
num_newopts; /* Number of new options */
cups_option_t *newopts; /* New options */
cups_array_t *active, /* Active constraints */
resolvers = NULL;
pass = cupsArrayNew((cups_array_func_t)strcasecmp, NULL);
+ tries = 0;
- while ((active = ppd_test_constraints(ppd, NULL, NULL, num_newopts, newopts,
+ while (tries < 100 &&
+ (active = ppd_test_constraints(ppd, NULL, NULL, num_newopts, newopts,
_PPD_ALL_CONSTRAINTS)) != NULL)
{
+ tries ++;
+
if (!resolvers)
resolvers = cupsArrayNew((cups_array_func_t)strcasecmp, NULL);
cupsArrayClear(pass);
cupsArrayDelete(active);
+ active = NULL;
}
+ if (tries >= 100)
+ goto error;
+
/*
* Free the caller's option array...
*/
# define CUPS_VERSION 1.0400
# define CUPS_VERSION_MAJOR 1
# define CUPS_VERSION_MINOR 4
-# define CUPS_VERSION_PATCH -1
+# define CUPS_VERSION_PATCH 0
# define CUPS_BC_FD 3 /* Back-channel file descriptor for select/poll */
# define CUPS_DATE_ANY (time_t)-1
extern int cupsSetDests2(http_t *http, int num_dests,
cups_dest_t *dests) _CUPS_API_1_1_21;
-/**** New in CUPS 1.2 ****/
+/**** New in CUPS 1.2/Mac OS X 10.5 ****/
extern ssize_t cupsBackChannelRead(char *buffer, size_t bytes,
double timeout) _CUPS_API_1_2;
extern ssize_t cupsBackChannelWrite(const char *buffer, size_t bytes,
cups_option_t **options) _CUPS_API_1_2;
extern cups_file_t *cupsTempFile2(char *filename, int len) _CUPS_API_1_2;
-/**** New in CUPS 1.3 ****/
+/**** New in CUPS 1.3/Mac OS X 10.5 ****/
extern ipp_t *cupsDoIORequest(http_t *http, ipp_t *request,
const char *resource, int infile,
int outfile) _CUPS_API_1_3;
int num_dests,
cups_dest_t *dests) _CUPS_API_1_3;
-/**** New in CUPS 1.4 ****/
+/**** New in CUPS 1.4/Mac OS X 10.6 ****/
extern ipp_status_t cupsCancelJob2(http_t *http, const char *name,
int job_id, int purge) _CUPS_API_1_4;
extern int cupsCreateJob(http_t *http, const char *name,
char *host, int hostlen, int *port,
char *resource, int resourcelen) _CUPS_DEPRECATED;
-/**** New in CUPS 1.2 ****/
+/**** New in CUPS 1.2/Mac OS X 10.5 ****/
extern int httpAddrAny(const http_addr_t *addr) _CUPS_API_1_2;
extern http_addrlist_t *httpAddrConnect(http_addrlist_t *addrlist, int *sock) _CUPS_API_1_2;
extern int httpAddrEqual(const http_addr_t *addr1,
extern ssize_t httpWrite2(http_t *http, const char *buffer,
size_t length) _CUPS_API_1_2;
-/**** New in CUPS 1.3 ****/
+/**** New in CUPS 1.3/Mac OS X 10.5 ****/
extern char *httpGetAuthString(http_t *http) _CUPS_API_1_3;
extern void httpSetAuthString(http_t *http, const char *scheme,
const char *data) _CUPS_API_1_3;
if (!language)
{
- if ((language = getenv("LANG")) == NULL)
+ if (!getenv("SOFTWARE") || (language = getenv("LANG")) == NULL)
language = appleLangDefault();
DEBUG_printf(("4cupsLangGet: language=\"%s\"", language));
/* Pointer to library globals */
+ DEBUG_puts("2appleLangDefault()");
+
/*
* Only do the lookup and translation the first time.
*/
if (!cg->language[0])
{
- if ((lang = getenv("LANG")))
+ if (getenv("SOFTWARE") != NULL && (lang = getenv("LANG")) != NULL)
{
strlcpy(cg->language, lang, sizeof(cg->language));
return (cg->language);
*
* Contents:
*
- * ppdPageSize() - Get the page size record for the given size.
- * ppdPageWidth() - Get the page width for the given size.
- * ppdPageLength() - Get the page length for the given size.
+ * ppdPageSize() - Get the page size record for the given size.
+ * ppdPageSizeLimits() - Return the custom page size limits.
+ * ppdPageWidth() - Get the page width for the given size.
+ * ppdPageLength() - Get the page length for the given size.
*/
/*
* Get the parameter data...
*/
- if (sscanf(string, "%d%32s%64s%64s", &corder, ctype, cminimum,
+ if (!string ||
+ sscanf(string, "%d%32s%64s%64s", &corder, ctype, cminimum,
cmaximum) != 4)
{
cg->ppd_status = PPD_BAD_CUSTOM_PARAM;
else if (!strcmp(keyword, "UIConstraints") ||
!strcmp(keyword, "NonUIConstraints"))
{
+ if (!string)
+ {
+ cg->ppd_status = PPD_BAD_UI_CONSTRAINTS;
+ goto error;
+ }
+
if (ppd->num_consts == 0)
constraint = calloc(2, sizeof(ppd_const_t));
else
float matrix[3][3]; /* Transform matrix */
} ppd_profile_t;
-/**** New in CUPS 1.2 ****/
+/**** New in CUPS 1.2/Mac OS X 10.5 ****/
typedef enum ppd_cptype_e /**** Custom Parameter Type @since CUPS 1.2/Mac OS X 10.5@ ****/
{
PPD_CUSTOM_CURVE, /* Curve value for f(x) = x^value */
int cur_attr; /* Current attribute @since CUPS 1.1.19/Mac OS X 10.3@ @private@ */
ppd_attr_t **attrs; /* Attributes @since CUPS 1.1.19/Mac OS X 10.3@ @private@ */
- /**** New in CUPS 1.2 ****/
+ /**** New in CUPS 1.2/Mac OS X 10.5 ****/
cups_array_t *sorted_attrs; /* Attribute lookup array @since CUPS 1.2/Mac OS X 10.5@ @private@ */
cups_array_t *options; /* Option lookup array @since CUPS 1.2/Mac OS X 10.5@ @private@ */
cups_array_t *coptions; /* Custom options array @since CUPS 1.2/Mac OS X 10.5@ @private@ */
- /**** New in CUPS 1.3 ****/
+ /**** New in CUPS 1.3/Mac OS X 10.5 ****/
cups_array_t *marked; /* Marked choices @since CUPS 1.3/Mac OS X 10.5@ @private@ */
- /**** New in CUPS 1.4 ****/
+ /**** New in CUPS 1.4/Mac OS X 10.6 ****/
cups_array_t *cups_uiconstraints; /* cupsUIConstraints @since CUPS 1.4/Mac OS X 10.6@ @private@ */
} ppd_file_t;
*
* Localization test program for the Common UNIX Printing System (CUPS).
*
- * Copyright 2007 by Apple Inc.
+ * Copyright 2007-2009 by Apple Inc.
* Copyright 1997-2006 by Easy Software Products.
*
* These coded instructions, statements, and computer programs are the
}
putenv("LOCALEDIR=locale");
+ putenv("SOFTWARE=CUPS");
/*
* Do tests with test.ppd...
Programming: <a href='api-cups.html' target='_top'>CUPS API</a><br>
Programming: <a href='api-ppd.html' target='_top'>PPD API</a><br>
Programming: <a href='api-raster.html' target='_top'>Raster API</a><br>
+ Programming: <a href='postscript-driver.html' target='_top'>Developing PostScript Printer Drivers</a><br>
+ Programming: <a href='raster-driver.html' target='_top'>Developing Raster Printer Drivers</a><br>
Specifications: <a href='spec-design' target='_top'>CUPS Design Description</a></td>
</tr>
</tbody>
<div class='figure'><table summary='PostScript Filter Chain'>
<caption>Figure 1: <a name='FIGURE_1'>PostScript Filter Chain</a></caption>
-<tr><td><img src='/images/cups-postscript-chain.png' width='700' height='150' alt='PostScript Filter Chain'></td></tr>
+<tr><td><img src='../images/cups-postscript-chain.png' width='700' height='150' alt='PostScript Filter Chain'></td></tr>
</table></div>
<p>The optional PostScript filter can be provided to add printer-specific commands to the PostScript output that cannot be represented in the PPD file or to reorganize the output for special printer features. Typically this is used to support advanced job management or finishing functions on the printer. CUPS includes a generic PostScript filter that handles all PPD-defined commands.</p>
<div class='figure'><table summary='Command Filter Chain'>
<caption>Figure 2: <a name='FIGURE_2'>Command Filter Chain</a></caption>
-<tr><td><img src='/images/cups-command-chain.png' width='575' height='150' alt='Command Filter Chain'></td></tr>
+<tr><td><img src='../images/cups-command-chain.png' width='575' height='150' alt='Command Filter Chain'></td></tr>
</table></div>
<p>PostScript printer drivers typically do not require their own command filter since CUPS includes a generic PostScript command filter that supports all of the standard functions using PPD-defined commands.</p>
<div class='figure'><table summary='Raster Filter Chain'>
<caption>Figure 1: <a name='FIGURE_1'>Raster Filter Chain</a></caption>
-<tr><td><img src='/images/cups-raster-chain.png' width='700' height='150' alt='Raster Filter Chain'></td></tr>
+<tr><td><img src='../images/cups-raster-chain.png' width='700' height='150' alt='Raster Filter Chain'></td></tr>
</table></div>
<p>The raster filter converts CUPS raster data into a format the printer understands, for example HP-PCL. CUPS includes several sample raster filters supporting standard page description languages (PDLs). <a href='#TABLE_1'>Table 1</a> shows the raster filters that are bundled with CUPS and the languages they support.</p>
<div class='figure'><table summary='Command Filter Chain'>
<caption>Figure 2: <a name='FIGURE_2'>Command Filter Chain</a></caption>
-<tr><td><img src='/images/cups-command-chain.png' width='575' height='150' alt='Command Filter Chain'></td></tr>
+<tr><td><img src='../images/cups-command-chain.png' width='575' height='150' alt='Command Filter Chain'></td></tr>
</table></div>
<p>Raster printer drivers must provide their own command filter.</p>
systems between updates.</P>
-<H2 CLASS="title"><SPAN CLASS="info">CUPS 1.2</SPAN><A NAME="BrowseLDAPBindDN">BrowseLDAPBindDN</A></H2>
+<H2 CLASS="title"><SPAN CLASS="info">CUPS 1.2/Mac OS X 10.5</SPAN><A NAME="BrowseLDAPBindDN">BrowseLDAPBindDN</A></H2>
<H3>Examples</H3>
default is undefined.</P>
-<H2 CLASS="title"><SPAN CLASS="info">CUPS 1.4</SPAN><A NAME="BrowseLDAPCACertFile">BrowseLDAPCACertFile</A></H2>
+<H2 CLASS="title"><SPAN CLASS="info">CUPS 1.4/Mac OS X 10.6</SPAN><A NAME="BrowseLDAPCACertFile">BrowseLDAPCACertFile</A></H2>
<H3>Examples</H3>
authority file to use for LDAP + SSL. The default is undefined.</P>
-<H2 CLASS="title"><SPAN CLASS="info">CUPS 1.2</SPAN><A NAME="BrowseLDAPDN">BrowseLDAPDN</A></H2>
+<H2 CLASS="title"><SPAN CLASS="info">CUPS 1.2/Mac OS X 10.5</SPAN><A NAME="BrowseLDAPDN">BrowseLDAPDN</A></H2>
<H3>Examples</H3>
default is undefined.</P>
-<H2 CLASS="title"><SPAN CLASS="info">CUPS 1.2</SPAN><A NAME="BrowseLDAPPassword">BrowseLDAPPassword</A></H2>
+<H2 CLASS="title"><SPAN CLASS="info">CUPS 1.2/Mac OS X 10.5</SPAN><A NAME="BrowseLDAPPassword">BrowseLDAPPassword</A></H2>
<H3>Examples</H3>
default is undefined.</P>
-<H2 CLASS="title"><SPAN CLASS="info">CUPS 1.2</SPAN><A NAME="BrowseLDAPServer">BrowseLDAPServer</A></H2>
+<H2 CLASS="title"><SPAN CLASS="info">CUPS 1.2/Mac OS X 10.5</SPAN><A NAME="BrowseLDAPServer">BrowseLDAPServer</A></H2>
<H3>Examples</H3>
printers. The default is to not include any options.</P>
-<H2 CLASS="title"><SPAN CLASS="info">CUPS 1.2</SPAN><A NAME="BrowseLocalProtocols">BrowseLocalProtocols</A></H2>
+<H2 CLASS="title"><SPAN CLASS="info">CUPS 1.2/Mac OS X 10.5</SPAN><A NAME="BrowseLocalProtocols">BrowseLocalProtocols</A></H2>
<H3>Examples</H3>
The default is to not include any options.</P>
-<H2 CLASS="title"><SPAN CLASS="info">CUPS 1.2</SPAN><A NAME="BrowseRemoteProtocols">BrowseRemoteProtocols</A></H2>
+<H2 CLASS="title"><SPAN CLASS="info">CUPS 1.2/Mac OS X 10.5</SPAN><A NAME="BrowseRemoteProtocols">BrowseRemoteProtocols</A></H2>
<H3>Examples</H3>
for data files.</P>
-<H2 CLASS="title"><SPAN CLASS="info">CUPS 1.2</SPAN><A NAME="DefaultAuthType">DefaultAuthType</A></H2>
+<H2 CLASS="title"><SPAN CLASS="info">CUPS 1.2/Mac OS X 10.5</SPAN><A NAME="DefaultAuthType">DefaultAuthType</A></H2>
<H3>Examples</H3>
<CODE>DefaultLanguage</CODE> directive.</P>
-<H2 CLASS="title"><SPAN CLASS="info">CUPS 1.2</SPAN><A NAME="DefaultEncryption">DefaultEncryption</A></H2>
+<H2 CLASS="title"><SPAN CLASS="info">CUPS 1.2/Mac OS X 10.5</SPAN><A NAME="DefaultEncryption">DefaultEncryption</A></H2>
<H3>Examples</H3>
is "en" for English.</P>
-<H2 CLASS="title"><SPAN CLASS="info">CUPS 1.4</SPAN><A NAME="DefaultPaperSize">DefaultPaperSize</A></H2>
+<H2 CLASS="title"><SPAN CLASS="info">CUPS 1.4/Mac OS X 10.6</SPAN><A NAME="DefaultPaperSize">DefaultPaperSize</A></H2>
<H3>Examples</H3>
size.</P>
-<H2 CLASS="title"><SPAN CLASS="info">CUPS 1.2</SPAN><A NAME="DefaultPolicy">DefaultPolicy</A></H2>
+<H2 CLASS="title"><SPAN CLASS="info">CUPS 1.2/Mac OS X 10.5</SPAN><A NAME="DefaultPolicy">DefaultPolicy</A></H2>
<H3>Examples</H3>
<CODE>default</CODE>.</P>
-<H2 CLASS="title"><SPAN CLASS="info">CUPS 1.2</SPAN><A NAME="DefaultShared">DefaultShared</A></H2>
+<H2 CLASS="title"><SPAN CLASS="info">CUPS 1.2/Mac OS X 10.5</SPAN><A NAME="DefaultShared">DefaultShared</A></H2>
<H3>Examples</H3>
information to the system log instead of a plain file.</P>
-<H2 CLASS="title"><SPAN CLASS="info">CUPS 1.3</SPAN><A NAME="ErrorPolicy">ErrorPolicy</A></H2>
+<H2 CLASS="title"><SPAN CLASS="info">CUPS 1.3/Mac OS X 10.5</SPAN><A NAME="ErrorPolicy">ErrorPolicy</A></H2>
<H3>Examples</H3>
-<H2 CLASS="title"><SPAN CLASS="info">CUPS 1.4</SPAN><A NAME="FatalErrors">FatalErrors</A></H2>
+<H2 CLASS="title"><SPAN CLASS="info">CUPS 1.4/Mac OS X 10.6</SPAN><A NAME="FatalErrors">FatalErrors</A></H2>
<H3>Examples</H3>
HREF="#ServerRoot"><CODE>ServerRoot</CODE></A> directory.</P>
-<H2 CLASS="title"><SPAN CLASS="info">CUPS 1.2</SPAN><A NAME="JobRetryInterval">JobRetryInterval</A></H2>
+<H2 CLASS="title"><SPAN CLASS="info">CUPS 1.2/Mac OS X 10.5</SPAN><A NAME="JobRetryInterval">JobRetryInterval</A></H2>
<H3>Examples</H3>
default is 30 seconds.</P>
-<H2 CLASS="title"><SPAN CLASS="info">CUPS 1.4</SPAN><A NAME="JobKillDelay">JobKillDelay</A></H2>
+<H2 CLASS="title"><SPAN CLASS="info">CUPS 1.4/Mac OS X 10.6</SPAN><A NAME="JobKillDelay">JobKillDelay</A></H2>
<H3>Examples</H3>
job. The default is 30 seconds.</P>
-<H2 CLASS="title"><SPAN CLASS="info">CUPS 1.2</SPAN><A NAME="JobRetryLimit">JobRetryLimit</A></H2>
+<H2 CLASS="title"><SPAN CLASS="info">CUPS 1.2/Mac OS X 10.5</SPAN><A NAME="JobRetryLimit">JobRetryLimit</A></H2>
<H3>Examples</H3>
Apache.</P>
-<H2 CLASS="title"><SPAN CLASS="info">CUPS 1.2</SPAN><A NAME="LimitIPP">Limit (Policy)</A></H2>
+<H2 CLASS="title"><SPAN CLASS="info">CUPS 1.2/Mac OS X 10.5</SPAN><A NAME="LimitIPP">Limit (Policy)</A></H2>
<H3>Examples</H3>
directive instead.</P>
-<H2 CLASS="title"><SPAN CLASS="info">CUPS 1.4</SPAN><A NAME="MultipleOperationTimeout">MultipleOperationTimeout</A></H2>
+<H2 CLASS="title"><SPAN CLASS="info">CUPS 1.4/Mac OS X 10.6</SPAN><A NAME="MultipleOperationTimeout">MultipleOperationTimeout</A></H2>
<H3>Examples</H3>
<P>The default is "%p %j %u %T %P %C %{job-billing} %{job-originating-host-name} %{job-name} %{media} %{sides}".</P>
-<H2 CLASS="title"><SPAN CLASS="info">CUPS 1.2</SPAN><A NAME="PassEnv">PassEnv</A></H2>
+<H2 CLASS="title"><SPAN CLASS="info">CUPS 1.2/Mac OS X 10.5</SPAN><A NAME="PassEnv">PassEnv</A></H2>
<H3>Examples</H3>
environment variables to child processes.</P>
-<H2 CLASS="title"><SPAN CLASS="info">CUPS 1.2</SPAN><A NAME="Policy">Policy</A></H2>
+<H2 CLASS="title"><SPAN CLASS="info">CUPS 1.2/Mac OS X 10.5</SPAN><A NAME="Policy">Policy</A></H2>
<H3>Examples</H3>
</TABLE></DIV>
-<H2 CLASS="title"><SPAN CLASS="info">CUPS 1.2</SPAN><A NAME="SetEnv">SetEnv</A></H2>
+<H2 CLASS="title"><SPAN CLASS="info">CUPS 1.2/Mac OS X 10.5</SPAN><A NAME="SetEnv">SetEnv</A></H2>
<H3>Examples</H3>
default timeout is 300 seconds.</P>
-<H2 CLASS="title"><SPAN CLASS="info">CUPS 1.2</SPAN><A NAME="UseNetworkDefault">UseNetworkDefault</A></H2>
+<H2 CLASS="title"><SPAN CLASS="info">CUPS 1.2/Mac OS X 10.5</SPAN><A NAME="UseNetworkDefault">UseNetworkDefault</A></H2>
<H3>Examples</H3>
case-insensitive and can be any sequence of letters, numbers,
and the underscore. The value can be any valid expression.</p>
+<h3>Predefined Names</h3>
+
+<p>The following <code>#define</code> names are set by the PPD compiler:</p>
+
+<ul>
+
+ <li><code>CUPS_VERSION</code> - The full CUPS version string, e.g.
+ "1.4.0"</li>
+
+ <li><code>CUPS_VERSION_MAJOR</code> - The major version number, e.g.
+ "1"</li>
+
+ <li><code>CUPS_VERSION_MINOR</code> - The minor version number, e.g.
+ "4"</li>
+
+ <li><code>CUPS_VERSION_PATCH</code> - The patch version number, e.g.
+ "0"</li>
+
+ <li><code>PLATFORM_NAME</code> - The operating system name used by the
+ current system as reported by "uname" ("Windows" on Microsoft
+ Windows)</li>
+
+ <li><code>PLATFORM_ARCH</code> - The processor architecture used by the
+ current system as reported by "uname -m" ("X86" or "X64" on Microsoft
+ Windows)</li>
+
+</ul>
+
<h3>See Also</h3>
<p><a href='#_include'><code>#include</code></a></p>
<dl>
- <dt>"auth-info" (1setOf text(MAX)):<span class='info'>CUPS 1.3</span>
+ <dt>"auth-info" (1setOf text(MAX)):<span class='info'>CUPS 1.3/Mac OS X 10.5</span>
<dd>The client OPTIONALLY supplies one or more authentication values as specified by the "auth-info-required" attribute.
<dl>
- <dt>"auth-info" (1setOf text(MAX)):<span class='info'>CUPS 1.3</span>
+ <dt>"auth-info" (1setOf text(MAX)):<span class='info'>CUPS 1.3/Mac OS X 10.5</span>
<dd>The client OPTIONALLY supplies one or more authentication values as specified by the "auth-info-required" attribute.
<dd>The client MUST supply a URI for the specified printer and
a job ID number, or the job URI.
- <dt><span class="info">CUPS 1.4</span>"purge-job" (boolean):
+ <dt><span class="info">CUPS 1.4/Mac OS X 10.6</span>"purge-job" (boolean):
<dd>The client OPTIONALLY supplies this attribute. When true,
all job files (history and document) are purged. The default
<dd>The client MUST supply a URI for the specified printer or
"ipp://.../printers" for all printers and classes.
- <dt><span class="info">CUPS 1.2</span>"purge-jobs" (boolean):
+ <dt><span class="info">CUPS 1.2/Mac OS X 10.5</span>"purge-jobs" (boolean):
<dd>The client OPTIONALLY supplies this attribute to specify
whether the jobs are purged (true) or just canceled (false).
</dl>
-<h3 class='title'><span class='info'>CUPS 1.2</span><a
+<h3 class='title'><span class='info'>CUPS 1.2/Mac OS X 10.5</span><a
name='CREATE_PRINTER_SUBSCRIPTION'>Create-Printer-Subscription</a></h3>
<p>The Create-Printer-Subscription operation (0x0016) creates a
attributes as described in section 3.1.4.1 of the IPP Model and
Semantics document.
- <dt>"first-printer-name" (name(127)):<span class='info'>CUPS 1.2</span>
+ <dt>"first-printer-name" (name(127)):<span class='info'>CUPS 1.2/Mac OS X 10.5</span>
<dd>The client OPTIONALLY supplies this attribute to
select the first printer that is returned.
responds as if this attribute had been supplied with a value of
'all'.
- <dt>"requested-user-name" (name(127)) : <span class='info'>CUPS 1.2</span>
+ <dt>"requested-user-name" (name(127)) : <span class='info'>CUPS 1.2/Mac OS X 10.5</span>
<dd>The client OPTIONALLY supplies a user name that is used to filter
the returned printers.
<dl>
- <dt>"auth-info-required" (1setOf type2 keyword):<span class='info'>CUPS 1.3</span>
+ <dt>"auth-info-required" (1setOf type2 keyword):<span class='info'>CUPS 1.3/Mac OS X 10.5</span>
<dd>The client OPTIONALLY supplies one or more authentication keywords that are required to communicate with the printer/remote queue.
attributes as described in section 3.1.4.1 of the IPP Model and
Semantics document.
- <dt>"first-printer-name" (name(127)):<span class='info'>CUPS 1.2</span>
+ <dt>"first-printer-name" (name(127)):<span class='info'>CUPS 1.2/Mac OS X 10.5</span>
<dd>The client OPTIONALLY supplies this attribute to
select the first printer that is returned.
interested. If the client omits this attribute, the server responds as
if this attribute had been supplied with a value of 'all'.
- <dt>"requested-user-name" (name(127)) : <span class='info'>CUPS 1.2</span>
+ <dt>"requested-user-name" (name(127)) : <span class='info'>CUPS 1.2/Mac OS X 10.5</span>
<dd>The client OPTIONALLY supplies a user name that is used to filter
the returned printers.
<dl>
- <dt>"auth-info-required" (1setOf type2 keyword):<span class='info'>CUPS 1.3</span>
+ <dt>"auth-info-required" (1setOf type2 keyword):<span class='info'>CUPS 1.3/Mac OS X 10.5</span>
<dd>The client OPTIONALLY supplies one or more authentication keywords that are required to communicate with the printer/remote queue.
<dd>The client OPTIONALLY supplies a device class keyword to select
which devices are returned.
- <dt>"exclude-schemes" (1setOf name) :<span class='info'>CUPS 1.4</span>
+ <dt>"exclude-schemes" (1setOf name) :<span class='info'>CUPS 1.4/Mac OS X 10.6</span>
<dd>The client OPTIONALLY supplies a set of scheme names that the
requestor does not want to discover. If the client omits this attribute,
the server responds with devices of all schemes specified by
the "include-schemes" attribute.
- <dt>"include-schemes" (1setOf name) :<span class='info'>CUPS 1.4</span>
+ <dt>"include-schemes" (1setOf name) :<span class='info'>CUPS 1.4/Mac OS X 10.6</span>
<dd>The client OPTIONALLY supplies a set of scheme names that the
requestor wants to discover. If the client omits this attribute,
the client omits this attribute, the server responds as if this
attribute had been supplied with a value of 'all'.
- <dt>"timeout" (integer (1:MAX)) :<span class='info'>CUPS 1.4</span>
+ <dt>"timeout" (integer (1:MAX)) :<span class='info'>CUPS 1.4/Mac OS X 10.6</span>
<dd>The client OPTIONALLY supplies this attribute limiting the number of
devices that are returned.
attributes as described in section 3.1.4.1 of the IPP Model and
Semantics document.
- <dt>"exclude-schemes" (1setOf name) :<span class='info'>CUPS 1.4</span>
+ <dt>"exclude-schemes" (1setOf name) :<span class='info'>CUPS 1.4/Mac OS X 10.6</span>
<dd>The client OPTIONALLY supplies a set of scheme names that the
requestor does not want to list. If the client omits this attribute,
the server responds with PPDs of all schemes specified by the
"include-schemes" attribute.
- <dt>"include-schemes" (1setOf name) :<span class='info'>CUPS 1.4</span>
+ <dt>"include-schemes" (1setOf name) :<span class='info'>CUPS 1.4/Mac OS X 10.6</span>
<dd>The client OPTIONALLY supplies a set of scheme names that the
requestor wants to list. If the client omits this attribute, the server
<dd>The client OPTIONALLY supplies a printer manufacturer to select which PPDs are returned.
- <dt>"ppd-make-and-model" (text(127)):<span class='info'>CUPS 1.3</span>
+ <dt>"ppd-make-and-model" (text(127)):<span class='info'>CUPS 1.3/Mac OS X 10.5</span>
<dd>The client OPTIONALLY supplies a make and model to select which PPDs are returned.
- <dt>"ppd-model-number" (integer):<span class='info'>CUPS 1.3</span>
+ <dt>"ppd-model-number" (integer):<span class='info'>CUPS 1.3/Mac OS X 10.5</span>
<dd>The client OPTIONALLY supplies a model number to select which PPDs are returned.
- <dt>"ppd-natural-language" (naturalLanguage):<span class='info'>CUPS 1.3</span>
+ <dt>"ppd-natural-language" (naturalLanguage):<span class='info'>CUPS 1.3/Mac OS X 10.5</span>
<dd>The client OPTIONALLY supplies a language to select which PPDs are returned.
- <dt>"ppd-product" (text(127)):<span class='info'>CUPS 1.3</span>
+ <dt>"ppd-product" (text(127)):<span class='info'>CUPS 1.3/Mac OS X 10.5</span>
<dd>The client OPTIONALLY supplies a PostScript product string to select which PPDs are returned.
- <dt>"ppd-psversion" (text(127)):<span class='info'>CUPS 1.3</span>
+ <dt>"ppd-psversion" (text(127)):<span class='info'>CUPS 1.3/Mac OS X 10.5</span>
<dd>The client OPTIONALLY supplies a PostScript version string to select which PPDs are returned.
- <dt>"ppd-type" (type1 keyword):<span class='info'>CUPS 1.3</span>
+ <dt>"ppd-type" (type1 keyword):<span class='info'>CUPS 1.3/Mac OS X 10.5</span>
<dd>The client OPTIONALLY supplies a driver type to select which PPDs are returned.
</dl>
-<h3 class='title'><span class='info'>CUPS 1.2</span><a name='CUPS_AUTHENTICATE_JOB'>CUPS-Authenticate-Job Operation</a></h3>
+<h3 class='title'><span class='info'>CUPS 1.2/Mac OS X 10.5</span><a name='CUPS_AUTHENTICATE_JOB'>CUPS-Authenticate-Job Operation</a></h3>
<p>The CUPS-Authenticate-Job operation (0x400E) authenticates a print job for
printing, releasing the job if it is held. Typically this is used when printing
<dl>
- <dt>"auth-info" (1setOf text(MAX)):<span class='info'>CUPS 1.3</span>
+ <dt>"auth-info" (1setOf text(MAX)):<span class='info'>CUPS 1.3/Mac OS X 10.5</span>
<dd>The client OPTIONALLY supplies one or more authentication values as specified by the "auth-info-required" attribute.
- <dt>"job-hold-until" (keyword | name(MAX)):<span class='info'>CUPS 1.3</span>
+ <dt>"job-hold-until" (keyword | name(MAX)):<span class='info'>CUPS 1.3/Mac OS X 10.5</span>
<dd>The client OPTIONALLY supplies a new job-hold-until value for the
job. If specified and not the "no-hold" value, the job is held instead
</dl>
-<h3 class='title'><span class='info'>CUPS 1.3</span><a name='CUPS_GET_PPD'>CUPS-Get-PPD Operation</a></h3>
+<h3 class='title'><span class='info'>CUPS 1.3/Mac OS X 10.5</span><a name='CUPS_GET_PPD'>CUPS-Get-PPD Operation</a></h3>
<p>The CUPS-Get-PPD operation (0x400F) gets a PPD file from the
server. The PPD file can be specified using a <tt>ppd-name</tt>
<p>If the status code is <tt>successful-ok</tt>, the PPD file follows
the end of the IPP response.</p>
-<h3 class='title'><span class='info'>CUPS 1.4</span><a name='CUPS_GET_DOCUMENT'>CUPS-Get-Document Operation</a></h3>
+<h3 class='title'><span class='info'>CUPS 1.4/Mac OS X 10.6</span><a name='CUPS_GET_DOCUMENT'>CUPS-Get-Document Operation</a></h3>
<p>The CUPS-Get-Document operation (0x4027) gets a document file from a
job on the server. The document file is specified using the
</ul>
-<h4><a name="device-id">device-id (text(127))</a><span class="info">CUPS 1.2</span></h4>
+<h4><a name="device-id">device-id (text(127))</a><span class="info">CUPS 1.2/Mac OS X 10.5</span></h4>
<p>The device-id attribute specifies the IEEE-1284 device ID
string for the device.</p>
<p>The device-info attribute specifies a human-readable string describing
the device, e.g. "Parallel Port #1".
-<h4><a name="device-location">device-location (text(127))</a><span class="info">CUPS 1.4</span></h4>
+<h4><a name="device-location">device-location (text(127))</a><span class="info">CUPS 1.4/Mac OS X 10.6</span></h4>
<p>The device-location attribute specifies the physical location of the
printer.
<h3 class='title'><a name='JOB_TEMPLATE_ATTRIBUTES'>Job Template Attributes</a></h3>
-<h4><a name="auth-info">auth-info (1setOf text(MAX))</a><span class="info">CUPS 1.3</span></h4>
+<h4><a name="auth-info">auth-info (1setOf text(MAX))</a><span class="info">CUPS 1.3/Mac OS X 10.5</span></h4>
<p>The auth-info attribute specifies the authentication information to use when printing to a remote device. The order and content of each text value is specifed by the <a href="#auth-info-required">auth-info-required</a> printer attribute.
<p>The document-count attribute specifies the number of documents that
are present in the job.
-<h4><a name="fit-to-page">fit-to-page (boolean)</a><span class="info">CUPS 1.4</span></h4>
+<h4><a name="fit-to-page">fit-to-page (boolean)</a><span class="info">CUPS 1.4/Mac OS X 10.6</span></h4>
<p>The fit-to-page attribute specifies whether to scale documents to fit on the
selected media (fit-to-page=true) or use the physical size specified in the
specified time is less than the current time, the job is held until the
next day.
-<h4><a name="job-media-progress">job-media-progress (integer(0:100))</a><span class='info'>CUPS 1.4</span></h4>
+<h4><a name="job-media-progress">job-media-progress (integer(0:100))</a><span class='info'>CUPS 1.4/Mac OS X 10.6</span></h4>
<p>The job-media-progress attribute specifies the percentage of completion of
the current page. It is only valid when the job-state attribute has the
"processing" value (5).</p>
-<h4><a name="job-printer-state-message">job-printer-state-message (text(MAX))</a><span class='info'>CUPS 1.3</span></h4>
+<h4><a name="job-printer-state-message">job-printer-state-message (text(MAX))</a><span class='info'>CUPS 1.3/Mac OS X 10.5</span></h4>
<p>The job-printer-state-message attribute provides the last known value of the printer-state-message attribute for the printer that processed (or is processing) the job.</p>
-<h4><a name="job-printer-state-reasons">job-printer-state-reasons (1setOf type2 keyword)</a><span class='info'>CUPS 1.3</span></h4>
+<h4><a name="job-printer-state-reasons">job-printer-state-reasons (1setOf type2 keyword)</a><span class='info'>CUPS 1.3/Mac OS X 10.5</span></h4>
<p>The job-printer-state-reasons attribute provides the last known value of the printer-state-reasons attribute for the printer that processed (or is processing) the job.</p>
make and model is not specified in the PPD file then the ModelName or
ShortNickName attributes are used instead.
-<h4><a name="ppd-model-number">ppd-model-number (integer)</a><span class="info">CUPS 1.3</span></h4>
+<h4><a name="ppd-model-number">ppd-model-number (integer)</a><span class="info">CUPS 1.3/Mac OS X 10.5</span></h4>
<p>The ppd-model-number attribute provides the <tt>cupsModelNumber</tt> value from the PPD file.
<p>The ppd-product attribute specifies the Product attribute values in the PPD file.
-<h4><a name="ppd-psversion">ppd-psversion (1setOf text(127))</a><span class="info">CUPS 1.3</span></h4>
+<h4><a name="ppd-psversion">ppd-psversion (1setOf text(127))</a><span class="info">CUPS 1.3/Mac OS X 10.5</span></h4>
<p>The ppd-product attribute specifies the PSVersion attribute values in the PPD file.
-<h4><a name="ppd-type">ppd-type (type1 keyword)</a><span class="info">CUPS 1.3</span></h4>
+<h4><a name="ppd-type">ppd-type (type1 keyword)</a><span class="info">CUPS 1.3/Mac OS X 10.5</span></h4>
<p>The ppd-type attribute specifies the type of driver described by the PPD file:</p>
<h3 class='title'><a name='PRINTER_ATTRIBUTES'>Printer Attributes</a></h3>
-<h4><a name="auth-info-required">auth-info-required (1setOf type2 keyword)</a><span class="info">CUPS 1.3</span></h4>
+<h4><a name="auth-info-required">auth-info-required (1setOf type2 keyword)</a><span class="info">CUPS 1.3/Mac OS X 10.5</span></h4>
<p>The auth-info-required attribute specifies the authentication information that is required for printing a job. The following keywords are recognized:</p>
<p>The job-sheets-supported attribute specifies the available banner files.
There will always be at least one banner file available called "none".
-<h4><a name="marker-change-time">marker-change-time (integer)</a><span class='info'>CUPS 1.3</span></h4>
+<h4><a name="marker-change-time">marker-change-time (integer)</a><span class='info'>CUPS 1.3/Mac OS X 10.5</span></h4>
<p>The marker-change-time attribute specifies the printer-up-time value when
the last change to the marker-colors, marker-levels, marker-message,
marker-names, or marker-types attributes was made.</p>
-<h4><a name="marker-colors">marker-colors (1setof name(MAX))</a><span class='info'>CUPS 1.3</span></h4>
+<h4><a name="marker-colors">marker-colors (1setof name(MAX))</a><span class='info'>CUPS 1.3/Mac OS X 10.5</span></h4>
<p>The marker-colors attribute specifies the color(s) for each supply in the
printer. It is only available when the driver provides supply levels. The
color is either "none" or one or more hex-encoded sRGB colors of the form
"#RRGGBB".</p>
-<h4><a name="marker-high-levels">marker-high-levels (1setof integer(0:100))</a><span class='info'>CUPS 1.4</span></h4>
+<h4><a name="marker-high-levels">marker-high-levels (1setof integer(0:100))</a><span class='info'>CUPS 1.4/Mac OS X 10.6</span></h4>
<p>The marker-high-levels attribute specifies the supply levels that indicate
a near-full condition. A value of 100 should be used for supplies that are
consumed/emptied, e.g. ink cartridges.</p>
-<h4><a name="marker-levels">marker-levels (1setof integer(-1:100))</a><span class='info'>CUPS 1.3</span></h4>
+<h4><a name="marker-levels">marker-levels (1setof integer(-1:100))</a><span class='info'>CUPS 1.3/Mac OS X 10.5</span></h4>
<p>The marker-levels attribute specifies the current supply levels for the
printer. It is only available when the driver provides supply levels. A
value of -1 indicates the level is unknown, while values from 0 to 100
indicate the corresponding percentage.</p>
-<h4><a name="marker-low-levels">marker-low-levels (1setof integer(0:100))</a><span class='info'>CUPS 1.4</span></h4>
+<h4><a name="marker-low-levels">marker-low-levels (1setof integer(0:100))</a><span class='info'>CUPS 1.4/Mac OS X 10.6</span></h4>
<p>The marker-low-levels attribute specifies the supply levels that indicate
a near-empty condition. A value of 0 should be used for supplies that are
filled, e.g. waste ink tanks.</p>
-<h4><a name="marker-message">marker-message (text(MAX))</a><span class='info'>CUPS 1.4</span></h4>
+<h4><a name="marker-message">marker-message (text(MAX))</a><span class='info'>CUPS 1.4/Mac OS X 10.6</span></h4>
<p>The marker-message attribute provides a human-readable status message
for the current supply levels, e.g. "12 pages of ink remaining." It is only
available when the driver provides supply levels.</p>
-<h4><a name="marker-names">marker-names (1setof name(MAX))</a><span class='info'>CUPS 1.3</span></h4>
+<h4><a name="marker-names">marker-names (1setof name(MAX))</a><span class='info'>CUPS 1.3/Mac OS X 10.5</span></h4>
<p>The marker-names attribute specifies the name(s) for each supply in the
printer. It is only available when the driver provides supply levels.</p>
-<h4><a name="marker-types">marker-types (1setof type3 keyword)</a><span class='info'>CUPS 1.3</span></h4>
+<h4><a name="marker-types">marker-types (1setof type3 keyword)</a><span class='info'>CUPS 1.3/Mac OS X 10.5</span></h4>
<p>The marker-types attribute specifies the type(s) of each supply in the
printer. It is only available when the driver provides supply levels. The
<p>The port-monitor-supported attribute specifies the available port monitors.
-<h4><a name="printer-commands">printer-commands (1setOf Type3 keyword)</a><span class='info'>CUPS 1.4</span></h4>
+<h4><a name="printer-commands">printer-commands (1setOf Type3 keyword)</a><span class='info'>CUPS 1.4/Mac OS X 10.6</span></h4>
<p>The printer-commands attribute specifies the commands that are supported
by the CUPS command file filter. The keyword "none" indicates that no commands
are supported.</p>
-<h4><a name="printer-dns-sd-name">printer-dns-sd-name (name(MAX) | noValue)</a><span class='info'>CUPS 1.4</span></h4>
+<h4><a name="printer-dns-sd-name">printer-dns-sd-name (name(MAX) | noValue)</a><span class='info'>CUPS 1.4/Mac OS X 10.6</span></h4>
<p>The printer-dns-sd-name attribute specifies the registered DNS-SD service
name for the printer. If the printer is not being shared using this protocol,
permissions. CUPS will not execute programs with world write permissions
or setuid programs. When run as root (the default), CUPS also does not
execute programs that are not owned by root.
- <span class='info'>CUPS 1.4</span></li>
+ <span class='info'>CUPS 1.4/Mac OS X 10.6</span></li>
<li><tt>cups-missing-filter-warning</tt> - a filter or backend is not
- installed. <span class='info'>CUPS 1.4</span></li>
+ installed. <span class='info'>CUPS 1.4/Mac OS X 10.6</span></li>
</ul>
</pre>
-<h3><span class='info'>Mac OS X 10.3/CUPS 1.2</span><a name='cupsICCProfile'>cupsICCProfile</a></h3>
+<h3><span class='info'>Mac OS X 10.3/CUPS 1.2/Mac OS X 10.5</span><a name='cupsICCProfile'>cupsICCProfile</a></h3>
<p class='summary'>*cupsICCProfile
ColorModel.MediaType.Resolution/Description: "filename"</p>
</blockquote>
-<h3><span class='info'>CUPS 1.4</span><a name='cupsUIConstraints'>cupsUIConstraints</a></h3>
+<h3><span class='info'>CUPS 1.4/Mac OS X 10.6</span><a name='cupsUIConstraints'>cupsUIConstraints</a></h3>
<p class='summary'>*cupsUIConstraints resolver: "*Keyword1 *Keyword2 ..."<br>
*cupsUIConstraints resolver: "*Keyword1 OptionKeyword1 *Keyword2 ..."<br>
*cupsUIConstraints photo: "*OutputMode Photo *MediaType Transparency *Resolution 1200dpi"
</pre>
-<h3><span class='info'>CUPS 1.4</span><a name='cupsUIResolver'>cupsUIResolver</a></h3>
+<h3><span class='info'>CUPS 1.4/Mac OS X 10.6</span><a name='cupsUIResolver'>cupsUIResolver</a></h3>
<p class='summary'>*cupsUIResolution resolver: "*Keyword1 OptionKeyword1 *Keyword2 OptionKeyword2 ..."</p>
<p>The CUPS media attributes allow drivers to specify alternate custom page
size limits based on up to two options.</p>
-<h3><span class='info'>CUPS 1.4</span><a name='cupsMediaQualifier2'>cupsMediaQualifier2</a></h3>
+<h3><span class='info'>CUPS 1.4/Mac OS X 10.6</span><a name='cupsMediaQualifier2'>cupsMediaQualifier2</a></h3>
<p class='summary'>*cupsMediaQualifier2: MainKeyword</p>
*cupsMinSize ..Photo: "300 300"
</pre>
-<h3><span class='info'>CUPS 1.4</span><a name='cupsMediaQualifier3'>cupsMediaQualifier3</a></h3>
+<h3><span class='info'>CUPS 1.4/Mac OS X 10.6</span><a name='cupsMediaQualifier3'>cupsMediaQualifier3</a></h3>
<p class='summary'>*cupsMediaQualifier3: MainKeyword</p>
*cupsMinSize ..Photo: "300 300"
</pre>
-<h3><span class='info'>CUPS 1.4</span><a name='cupsMinSize'>cupsMinSize</a></h3>
+<h3><span class='info'>CUPS 1.4/Mac OS X 10.6</span><a name='cupsMinSize'>cupsMinSize</a></h3>
<p class='summary'>*cupsMinSize .Qualifier2.Qualifier3: "width length"<br>
*cupsMinSize .Qualifier2.: "width length"<br>
*cupsMinSize ..Photo: "300 300"
</pre>
-<h3><span class='info'>CUPS 1.4</span><a name='cupsMaxSize'>cupsMaxSize</a></h3>
+<h3><span class='info'>CUPS 1.4/Mac OS X 10.6</span><a name='cupsMaxSize'>cupsMaxSize</a></h3>
<p class='summary'>*cupsMaxSize .Qualifier2.Qualifier3: "width length"<br>
*cupsMaxSize .Qualifier2.: "width length"<br>
<h2 class='title'><a name='ATTRIBUTES'>General Attributes</a></h2>
-<h3><span class='info'>CUPS 1.3</span><a name='cupsBackSide'>cupsBackSide</a></h3>
+<h3><span class='info'>CUPS 1.3/Mac OS X 10.5</span><a name='cupsBackSide'>cupsBackSide</a></h3>
<p class='summary'>*cupsBackSide: keyword</p>
<p>Also see the related <a href='#APDuplexRequiresFlippedMargin'><tt>APDuplexRequiresFlippedMargin</tt></a>
attribute.</p>
-<h3><span class='info'>CUPS 1.4</span><a name='cupsCommands'>cupsCommands</a></h3>
+<h3><span class='info'>CUPS 1.4/Mac OS X 10.6</span><a name='cupsCommands'>cupsCommands</a></h3>
<p class='summary'>*cupsCommands: "name name2 ... nameN"</p>
</pre>
-<h3><span class='info'>CUPS 1.3</span><a name='cupsEvenDuplex'>cupsEvenDuplex</a></h3>
+<h3><span class='info'>CUPS 1.3/Mac OS X 10.5</span><a name='cupsEvenDuplex'>cupsEvenDuplex</a></h3>
<p class='summary'>*cupsEvenDuplex: boolean</p>
*cupsFlipDuplex: true
</pre></blockquote>
-<h3><span class='info'>CUPS 1.3</span><a name='cupsIPPFinishings'>cupsIPPFinishings</a></h3>
+<h3><span class='info'>CUPS 1.3/Mac OS X 10.5</span><a name='cupsIPPFinishings'>cupsIPPFinishings</a></h3>
<p class='summary'>*cupsIPPFinishings number/text: "*Option Choice ..."</p>
*cupsIPPFinishings 21/staple-bottom-left: "*StapleLocation SingleLandscape"
</pre>
-<h3><span class='info'>CUPS 1.3</span><a name='cupsIPPReason'>cupsIPPReason</a></h3>
+<h3><span class='info'>CUPS 1.3/Mac OS X 10.5</span><a name='cupsIPPReason'>cupsIPPReason</a></h3>
<p class='summary'>*cupsIPPReason reason/Reason Text: "optional URIs"</p>
*End
</pre>
-<h3><span class='info'>CUPS 1.2</span><a name='cupsLanguages'>cupsLanguages</a></h3>
+<h3><span class='info'>CUPS 1.2/Mac OS X 10.5</span><a name='cupsLanguages'>cupsLanguages</a></h3>
<p class='summary'>*cupsLanguages: "locale list"</p>
*cupsManualCopies: true
</pre>
-<h3><span class='info'>CUPS 1.4</span><a name='cupsMarkerName'>cupsMarkerName</a></h3>
+<h3><span class='info'>CUPS 1.4/Mac OS X 10.6</span><a name='cupsMarkerName'>cupsMarkerName</a></h3>
<p class='summary'>*cupsMarkerName/Name Text: ""</p>
*cupsMarkerName cyanToner/Cyan Toner: ""
</pre>
-<h3><span class='info'>CUPS 1.4</span><a name='cupsMarkerNotice'>cupsMarkerNotice</a></h3>
+<h3><span class='info'>CUPS 1.4/Mac OS X 10.6</span><a name='cupsMarkerNotice'>cupsMarkerNotice</a></h3>
<p class='summary'>*cupsMarkerNotice: "disclaimer text"</p>
*cupsModelNumber: 1234
</pre>
-<h3><span class='info'>CUPS 1.3</span><a name='cupsPJLCharset'>cupsPJLCharset</a></h3>
+<h3><span class='info'>CUPS 1.3/Mac OS X 10.5</span><a name='cupsPJLCharset'>cupsPJLCharset</a></h3>
<p class='summary'>*cupsPJLCharset: "ISO character set name"</p>
*cupsPJLCharset: "UTF-8"
</pre>
-<h3><span class='info'>CUPS 1.4</span><a name='cupsPJLDisplay'>cupsPJLDisplay</a></h3>
+<h3><span class='info'>CUPS 1.4/Mac OS X 10.6</span><a name='cupsPJLDisplay'>cupsPJLDisplay</a></h3>
<p class='summary'>*cupsPJLDisplay: "what"</p>
*cupsPJLDisplay: "none"
</pre>
-<h3><span class='info'>CUPS 1.2</span><a name='cupsPortMonitor'>cupsPortMonitor</a></h3>
+<h3><span class='info'>CUPS 1.2/Mac OS X 10.5</span><a name='cupsPortMonitor'>cupsPortMonitor</a></h3>
<p class='summary'>*cupsPortMonitor urischeme/Descriptive Text: "port monitor"</p>
*cupsPortMonitor usb/USB Status Monitor: "epson-usb"
</pre>
-<h3><span class='info'>CUPS 1.3</span><a name='cupsPreFilter'>cupsPreFilter</a></h3>
+<h3><span class='info'>CUPS 1.3/Mac OS X 10.5</span><a name='cupsPreFilter'>cupsPreFilter</a></h3>
<p class='summary'>*cupsPreFilter: "source/type cost program"</p>
*cupsPreFilter: "image/png 0 mypngprefilter"
</pre>
-<h3><span class='info'>CUPS 1.4</span><a name='cupsSNMPSupplies'>cupsSNMPSupplies</a></h3>
+<h3><span class='info'>CUPS 1.4/Mac OS X 10.6</span><a name='cupsSNMPSupplies'>cupsSNMPSupplies</a></h3>
<p class='summary'>*cupsSNMPSupplies: boolean</p>
<h2 class='title'><a name='HISTORY'>Change History</a></h2>
-<h3>Changes in CUPS 1.4</a></h3>
+<h3>Changes in CUPS 1.4</h3>
<ul>
</ul>
-<h3>Changes in CUPS 1.3.1</a></h3>
+<h3>Changes in CUPS 1.3.1</h3>
<ul>
</ul>
-<h3>Changes in CUPS 1.3</a></h3>
+<h3>Changes in CUPS 1.3</h3>
<ul>
</ul>
-<h3>Changes in CUPS 1.2.8</a></h3>
+<h3>Changes in CUPS 1.2.8</h3>
<ul>
</ul>
-<h3>Changes in CUPS 1.2</a></h3>
+<h3>Changes in CUPS 1.2</h3>
<ul>
</ul>
-<h3>Changes in CUPS 1.1</a></h3>
+<h3>Changes in CUPS 1.1</h3>
<ul>
*
* If there are no recent errors, NULL is returned.
*
- * @since CUPS 1.3@
+ * @since CUPS 1.3/Mac OS X 10.5@
*/
const char * /* O - Last error */
*/
for (cur ++; *cur && *cur != '\n' && *cur != '\r'; cur ++);
+
+ if (!*cur)
+ cur --;
}
else if (!isspace(*cur & 255))
break;
fit; /* Fit output to default page size? */
ppd_file_t *ppd; /* PPD file */
ppd_size_t *size; /* Current page size */
- int pdfpid, /* Process ID for pdftops */
- pdfwaitpid, /* Process ID from wait() */
- pdfstatus, /* Status from pdftops */
- pdfargc; /* Number of args for pdftops */
- char *pdfargv[100], /* Arguments for pdftops/gs */
- pdfwidth[255], /* Paper width */
- pdfheight[255]; /* Paper height */
+ int pdf_pid, /* Process ID for pdftops */
+ pdf_argc, /* Number of args for pdftops */
+ pstops_pid, /* Process ID of pstops filter */
+ pstops_pipe[2], /* Pipe to pstops filter */
+ wait_children, /* Number of child processes left */
+ wait_pid, /* Process ID from wait() */
+ wait_status, /* Status from child */
+ exit_status = 0; /* Exit status */
+ char *pdf_argv[100], /* Arguments for pdftops/gs */
+ pdf_width[255], /* Paper width */
+ pdf_height[255], /* Paper height */
+ pstops_path[1024], /* Path to pstops program */
+ *pstops_argv[7], /* Arguments for pstops filter */
+ *pstops_options, /* Options for pstops filter */
+ *pstops_start, /* Start of pstops filter option */
+ *pstops_end; /* End of pstops filter option */
+ const char *cups_serverbin; /* CUPS_SERVERBIN environment variable */
#if defined(HAVE_SIGACTION) && !defined(HAVE_SIGSET)
struct sigaction action; /* Actions for POSIX signals */
#endif /* HAVE_SIGACTION && !HAVE_SIGSET */
ppdMarkDefaults(ppd);
cupsMarkOptions(ppd, num_options, options);
+ /*
+ * Build the pstops command-line...
+ */
+
+ if ((cups_serverbin = getenv("CUPS_SERVERBIN")) == NULL)
+ cups_serverbin = CUPS_SERVERBIN;
+
+ snprintf(pstops_path, sizeof(pstops_path), "%s/filter/pstops",
+ cups_serverbin);
+
+ pstops_options = strdup(argv[5]);
+
+ if ((pstops_start = strstr(pstops_options, "fitplot")) != NULL &&
+ (!pstops_start[7] || isspace(pstops_start[7] & 255)))
+ {
+ /*
+ * Strip [no]fitplot option...
+ */
+
+ pstops_end = pstops_start + 7;
+
+ if ((pstops_start - pstops_options) >= 2 &&
+ !strncmp(pstops_start - 2, "no", 2))
+ pstops_start -= 2;
+
+ while (*pstops_end && isspace(*pstops_end & 255))
+ pstops_end ++;
+
+ _cups_strcpy(pstops_start, pstops_end);
+ }
+
+ if ((pstops_start = strstr(pstops_options, "fit-to-page")) != NULL &&
+ (!pstops_start[11] || isspace(pstops_start[11] & 255)))
+ {
+ /*
+ * Strip [no]fit-to-page option...
+ */
+
+ pstops_end = pstops_start + 11;
+
+ if ((pstops_start - pstops_options) >= 2 &&
+ !strncmp(pstops_start - 2, "no", 2))
+ pstops_start -= 2;
+
+ while (*pstops_end && isspace(*pstops_end & 255))
+ pstops_end ++;
+
+ _cups_strcpy(pstops_start, pstops_end);
+ }
+
+ if ((pstops_start = strstr(pstops_options, "landscape")) != NULL &&
+ (!pstops_start[9] || isspace(pstops_start[9] & 255)))
+ {
+ /*
+ * Strip [no]landscape option...
+ */
+
+ pstops_end = pstops_start + 9;
+
+ if ((pstops_start - pstops_options) >= 2 &&
+ !strncmp(pstops_start - 2, "no", 2))
+ pstops_start -= 2;
+
+ while (*pstops_end && isspace(*pstops_end & 255))
+ pstops_end ++;
+
+ _cups_strcpy(pstops_start, pstops_end);
+ }
+
+ if ((pstops_start = strstr(pstops_options, "orientation-requested=")) != NULL)
+ {
+ /*
+ * Strip [no]fitplot option...
+ */
+
+ pstops_end = pstops_start + 22;
+ while (*pstops_end && !isspace(*pstops_end & 255))
+ pstops_end ++;
+
+ _cups_strcpy(pstops_start, pstops_end);
+ }
+
+ pstops_argv[0] = argv[0]; /* Printer */
+ pstops_argv[1] = argv[1]; /* Job */
+ pstops_argv[2] = argv[2]; /* User */
+ pstops_argv[3] = argv[3]; /* Title */
+ pstops_argv[4] = argv[4]; /* Copies */
+ pstops_argv[5] = pstops_options; /* Options */
+ pstops_argv[6] = NULL;
+
/*
* Build the command-line for the pdftops or gs filter...
*/
#ifdef HAVE_PDFTOPS
- pdfargv[0] = (char *)"pdftops";
- pdfargc = 1;
+ pdf_argv[0] = (char *)"pdftops";
+ pdf_argc = 1;
#else
- pdfargv[0] = (char *)"gs";
- pdfargv[1] = (char *)"-q";
- pdfargv[2] = (char *)"-dNOPAUSE";
- pdfargv[3] = (char *)"-dBATCH";
- pdfargv[4] = (char *)"-dSAFER";
- pdfargv[5] = (char *)"-sDEVICE=pswrite";
- pdfargv[6] = (char *)"-sOUTPUTFILE=%stdout";
- pdfargc = 7;
+ pdf_argv[0] = (char *)"gs";
+ pdf_argv[1] = (char *)"-q";
+ pdf_argv[2] = (char *)"-dNOPAUSE";
+ pdf_argv[3] = (char *)"-dBATCH";
+ pdf_argv[4] = (char *)"-dSAFER";
+ pdf_argv[5] = (char *)"-sDEVICE=pswrite";
+ pdf_argv[6] = (char *)"-sOUTPUTFILE=%stdout";
+ pdf_argc = 7;
#endif /* HAVE_PDFTOPS */
if (ppd)
if (ppd->language_level == 1)
{
#ifdef HAVE_PDFTOPS
- pdfargv[pdfargc++] = (char *)"-level1";
- pdfargv[pdfargc++] = (char *)"-noembtt";
+ pdf_argv[pdf_argc++] = (char *)"-level1";
+ pdf_argv[pdf_argc++] = (char *)"-noembtt";
#else
- pdfargv[pdfargc++] = (char *)"-dLanguageLevel=1";
+ pdf_argv[pdf_argc++] = (char *)"-dLanguageLevel=1";
#endif /* HAVE_PDFTOPS */
}
else if (ppd->language_level == 2)
{
#ifdef HAVE_PDFTOPS
- pdfargv[pdfargc++] = (char *)"-level2";
+ pdf_argv[pdf_argc++] = (char *)"-level2";
if (!ppd->ttrasterizer)
- pdfargv[pdfargc++] = (char *)"-noembtt";
+ pdf_argv[pdf_argc++] = (char *)"-noembtt";
#else
- pdfargv[pdfargc++] = (char *)"-dLanguageLevel=2";
+ pdf_argv[pdf_argc++] = (char *)"-dLanguageLevel=2";
#endif /* HAVE_PDFTOPS */
}
else
#ifdef HAVE_PDFTOPS
- pdfargv[pdfargc++] = (char *)"-level3";
+ pdf_argv[pdf_argc++] = (char *)"-level3";
#else
- pdfargv[pdfargc++] = (char *)"-dLanguageLevel=3";
+ pdf_argv[pdf_argc++] = (char *)"-dLanguageLevel=3";
#endif /* HAVE_PDFTOPS */
if ((val = cupsGetOption("fitplot", num_options, options)) == NULL)
#ifdef HAVE_PDFTOPS
if (orientation & 1)
{
- snprintf(pdfwidth, sizeof(pdfwidth), "%.0f", size->length);
- snprintf(pdfheight, sizeof(pdfheight), "%.0f", size->width);
+ snprintf(pdf_width, sizeof(pdf_width), "%.0f", size->length);
+ snprintf(pdf_height, sizeof(pdf_height), "%.0f", size->width);
}
else
{
- snprintf(pdfwidth, sizeof(pdfwidth), "%.0f", size->width);
- snprintf(pdfheight, sizeof(pdfheight), "%.0f", size->length);
+ snprintf(pdf_width, sizeof(pdf_width), "%.0f", size->width);
+ snprintf(pdf_height, sizeof(pdf_height), "%.0f", size->length);
}
- pdfargv[pdfargc++] = (char *)"-paperw";
- pdfargv[pdfargc++] = pdfwidth;
- pdfargv[pdfargc++] = (char *)"-paperh";
- pdfargv[pdfargc++] = pdfheight;
- pdfargv[pdfargc++] = (char *)"-expand";
+ pdf_argv[pdf_argc++] = (char *)"-paperw";
+ pdf_argv[pdf_argc++] = pdf_width;
+ pdf_argv[pdf_argc++] = (char *)"-paperh";
+ pdf_argv[pdf_argc++] = pdf_height;
+ pdf_argv[pdf_argc++] = (char *)"-expand";
#else
if (orientation & 1)
{
- snprintf(pdfwidth, sizeof(pdfwidth), "-dDEVICEWIDTHPOINTS=%.0f",
+ snprintf(pdf_width, sizeof(pdf_width), "-dDEVICEWIDTHPOINTS=%.0f",
size->length);
- snprintf(pdfheight, sizeof(pdfheight), "-dDEVICEHEIGHTPOINTS=%.0f",
+ snprintf(pdf_height, sizeof(pdf_height), "-dDEVICEHEIGHTPOINTS=%.0f",
size->width);
}
else
{
- snprintf(pdfwidth, sizeof(pdfwidth), "-dDEVICEWIDTHPOINTS=%.0f",
+ snprintf(pdf_width, sizeof(pdf_width), "-dDEVICEWIDTHPOINTS=%.0f",
size->width);
- snprintf(pdfheight, sizeof(pdfheight), "-dDEVICEHEIGHTPOINTS=%.0f",
+ snprintf(pdf_height, sizeof(pdf_height), "-dDEVICEHEIGHTPOINTS=%.0f",
size->length);
}
- pdfargv[pdfargc++] = pdfwidth;
- pdfargv[pdfargc++] = pdfheight;
+ pdf_argv[pdf_argc++] = pdf_width;
+ pdf_argv[pdf_argc++] = pdf_height;
#endif /* HAVE_PDFTOPS */
}
}
#ifdef HAVE_PDFTOPS
- pdfargv[pdfargc++] = filename;
- pdfargv[pdfargc++] = (char *)"-";
+ pdf_argv[pdf_argc++] = filename;
+ pdf_argv[pdf_argc++] = (char *)"-";
#else
- pdfargv[pdfargc++] = (char *)"-c";
- pdfargv[pdfargc++] = (char *)"save pop";
- pdfargv[pdfargc++] = (char *)"-f";
- pdfargv[pdfargc++] = filename;
+ pdf_argv[pdf_argc++] = (char *)"-c";
+ pdf_argv[pdf_argc++] = (char *)"save pop";
+ pdf_argv[pdf_argc++] = (char *)"-f";
+ pdf_argv[pdf_argc++] = filename;
#endif /* HAVE_PDFTOPS */
- pdfargv[pdfargc] = NULL;
+ pdf_argv[pdf_argc] = NULL;
+
+ /*
+ * Execute "pdftops/gs | pstops"...
+ */
+
+ if (pipe(pstops_pipe))
+ {
+ _cupsLangPrintError(_("ERROR: Unable to create pipe"));
+
+ exit_status = 1;
+ goto error;
+ }
- if ((pdfpid = fork()) == 0)
+ if ((pdf_pid = fork()) == 0)
{
/*
* Child comes here...
*/
+ dup2(pstops_pipe[1], 1);
+ close(pstops_pipe[0]);
+ close(pstops_pipe[1]);
+
#ifdef HAVE_PDFTOPS
- execv(CUPS_PDFTOPS, pdfargv);
+ execv(CUPS_PDFTOPS, pdf_argv);
_cupsLangPrintError(_("ERROR: Unable to execute pdftops program"));
#else
- execv(CUPS_GHOSTSCRIPT, pdfargv);
+ execv(CUPS_GHOSTSCRIPT, pdf_argv);
_cupsLangPrintError(_("ERROR: Unable to execute gs program"));
#endif /* HAVE_PDFTOPS */
exit(1);
}
- else if (pdfpid < 0)
+ else if (pdf_pid < 0)
{
/*
* Unable to fork!
_cupsLangPrintError(_("ERROR: Unable to execute gs program"));
#endif /* HAVE_PDFTOPS */
- pdfstatus = 1;
+ exit_status = 1;
+ goto error;
}
- else
+
+ fprintf(stderr, "DEBUG: Started filter %s (PID %d)\n", pdf_argv[0], pdf_pid);
+
+ if ((pstops_pid = fork()) == 0)
{
/*
- * Parent comes here...
+ * Child comes here...
*/
- while ((pdfwaitpid = wait(&pdfstatus)) != pdfpid && errno == EINTR)
- {
- /*
- * Wait until we get a valid process ID or the job is canceled...
- */
+ dup2(pstops_pipe[0], 0);
+ close(pstops_pipe[0]);
+ close(pstops_pipe[1]);
+
+ execv(pstops_path, pstops_argv);
+ _cupsLangPrintError(_("ERROR: Unable to execute pstops program"));
+
+ exit(1);
+ }
+ else if (pstops_pid < 0)
+ {
+ /*
+ * Unable to fork!
+ */
+
+ _cupsLangPrintError(_("ERROR: Unable to execute pstops program"));
+
+ exit_status = 1;
+ goto error;
+ }
+
+ fprintf(stderr, "DEBUG: Started filter pstops (PID %d)\n", pstops_pid);
+
+ close(pstops_pipe[0]);
+ close(pstops_pipe[1]);
+
+ /*
+ * Wait for the child processes to exit...
+ */
+
+ wait_children = 2;
+
+ while (wait_children > 0)
+ {
+ /*
+ * Wait until we get a valid process ID or the job is canceled...
+ */
+ while ((wait_pid = wait(&wait_status)) < 0 && errno == EINTR)
+ {
if (job_canceled)
{
- kill(pdfpid, SIGTERM);
+ kill(pdf_pid, SIGTERM);
+ kill(pstops_pid, SIGTERM);
+
job_canceled = 0;
}
}
- if (pdfstatus)
+ if (wait_pid < 0)
+ break;
+
+ wait_children --;
+
+ /*
+ * Report child status...
+ */
+
+ if (wait_status)
{
- if (WIFEXITED(pdfstatus))
+ if (WIFEXITED(wait_status))
{
- pdfstatus = WEXITSTATUS(pdfstatus);
+ exit_status = WEXITSTATUS(wait_status);
- _cupsLangPrintf(stderr,
- _("ERROR: pdftops filter exited with status %d!\n"),
- pdfstatus);
+ fprintf(stderr, "DEBUG: PID %d (%s) stopped with status %d!\n",
+ wait_pid,
+#ifdef HAVE_PDFTOPS
+ wait_pid == pdf_pid ? "pdftops" : "pstops",
+#else
+ wait_pid == pdf_pid ? "gs" : "pstops",
+#endif /* HAVE_PDFTOPS */
+ exit_status);
+ }
+ else if (WTERMSIG(wait_status) == SIGTERM)
+ {
+ fprintf(stderr,
+ "DEBUG: PID %d (%s) was terminated normally with signal %d!\n",
+ wait_pid,
+#ifdef HAVE_PDFTOPS
+ wait_pid == pdf_pid ? "pdftops" : "pstops",
+#else
+ wait_pid == pdf_pid ? "gs" : "pstops",
+#endif /* HAVE_PDFTOPS */
+ exit_status);
}
else
{
- pdfstatus = WTERMSIG(pdfstatus);
+ exit_status = WTERMSIG(wait_status);
- _cupsLangPrintf(stderr,
- _("ERROR: pdftops filter crashed on signal %d!\n"),
- pdfstatus);
+ fprintf(stderr, "DEBUG: PID %d (%s) crashed on signal %d!\n", wait_pid,
+#ifdef HAVE_PDFTOPS
+ wait_pid == pdf_pid ? "pdftops" : "pstops",
+#else
+ wait_pid == pdf_pid ? "gs" : "pstops",
+#endif /* HAVE_PDFTOPS */
+ exit_status);
}
}
+ else
+ {
+ fprintf(stderr, "DEBUG: PID %d (%s) exited with no errors.\n", wait_pid,
+#ifdef HAVE_PDFTOPS
+ wait_pid == pdf_pid ? "pdftops" : "pstops");
+#else
+ wait_pid == pdf_pid ? "gs" : "pstops");
+#endif /* HAVE_PDFTOPS */
+ }
}
/*
* Cleanup and exit...
*/
+ error:
+
if (tempfile[0])
unlink(tempfile);
- return (pdfstatus);
+ return (exit_status);
}
<div class='figure'><table summary='PostScript Filter Chain'>
<caption>Figure 1: <a name='FIGURE_1'>PostScript Filter Chain</a></caption>
-<tr><td><img src='/images/cups-postscript-chain.png' width='700' height='150' alt='PostScript Filter Chain'></td></tr>
+<tr><td><img src='../images/cups-postscript-chain.png' width='700' height='150' alt='PostScript Filter Chain'></td></tr>
</table></div>
<p>The optional PostScript filter can be provided to add printer-specific commands to the PostScript output that cannot be represented in the PPD file or to reorganize the output for special printer features. Typically this is used to support advanced job management or finishing functions on the printer. CUPS includes a generic PostScript filter that handles all PPD-defined commands.</p>
<div class='figure'><table summary='Command Filter Chain'>
<caption>Figure 2: <a name='FIGURE_2'>Command Filter Chain</a></caption>
-<tr><td><img src='/images/cups-command-chain.png' width='575' height='150' alt='Command Filter Chain'></td></tr>
+<tr><td><img src='../images/cups-command-chain.png' width='575' height='150' alt='Command Filter Chain'></td></tr>
</table></div>
<p>PostScript printer drivers typically do not require their own command filter since CUPS includes a generic PostScript command filter that supports all of the standard functions using PPD-defined commands.</p>
<div class='figure'><table summary='Raster Filter Chain'>
<caption>Figure 1: <a name='FIGURE_1'>Raster Filter Chain</a></caption>
-<tr><td><img src='/images/cups-raster-chain.png' width='700' height='150' alt='Raster Filter Chain'></td></tr>
+<tr><td><img src='../images/cups-raster-chain.png' width='700' height='150' alt='Raster Filter Chain'></td></tr>
</table></div>
<p>The raster filter converts CUPS raster data into a format the printer understands, for example HP-PCL. CUPS includes several sample raster filters supporting standard page description languages (PDLs). <a href='#TABLE_1'>Table 1</a> shows the raster filters that are bundled with CUPS and the languages they support.</p>
<div class='figure'><table summary='Command Filter Chain'>
<caption>Figure 2: <a name='FIGURE_2'>Command Filter Chain</a></caption>
-<tr><td><img src='/images/cups-command-chain.png' width='575' height='150' alt='Command Filter Chain'></td></tr>
+<tr><td><img src='../images/cups-command-chain.png' width='575' height='150' alt='Command Filter Chain'></td></tr>
</table></div>
<p>Raster printer drivers must provide their own command filter.</p>
#include "data/hp.h"
#include "data/label.h"
#include "data/pcl.h"
+#ifndef WIN32
+# include <sys/utsname.h>
+#endif // !WIN32
//
cond_current = cond_stack;
cond_stack[0] = PPDC_COND_NORMAL;
+ // Add standard #define variables...
+#define MAKE_STRING(x) #x
+
+ vars->add(new ppdcVariable("CUPS_VERSION", MAKE_STRING(CUPS_VERSION)));
+ vars->add(new ppdcVariable("CUPS_VERSION_MAJOR", MAKE_STRING(CUPS_VERSION_MAJOR)));
+ vars->add(new ppdcVariable("CUPS_VERSION_MINOR", MAKE_STRING(CUPS_VERSION_MINOR)));
+ vars->add(new ppdcVariable("CUPS_VERSION_PATCH", MAKE_STRING(CUPS_VERSION_PATCH)));
+
+#ifdef WIN32
+ vars->add(new ppdcVariable("PLATFORM_NAME", "Windows"));
+ vars->add(new ppdcVariable("PLATFORM_ARCH", "X86"));
+
+#else
+ struct utsname name; // uname information
+
+ vars->add(new ppdcVariable("PLATFORM_NAME", name.sysname));
+ vars->add(new ppdcVariable("PLATFORM_ARCH", name.machine));
+#endif // WIN32
+
if (f)
read_file(f, ffp);
}
* Constants...
*/
-#define PPD_SYNC 0x50504436 /* Sync word for ppds.dat (PPD6) */
+#define PPD_SYNC 0x50504437 /* Sync word for ppds.dat (PPD7) */
#define PPD_MAX_LANG 32 /* Maximum languages */
-#define PPD_MAX_PROD 8 /* Maximum products */
-#define PPD_MAX_VERS 8 /* Maximum versions */
+#define PPD_MAX_PROD 32 /* Maximum products */
+#define PPD_MAX_VERS 32 /* Maximum versions */
#define PPD_TYPE_POSTSCRIPT 0 /* PostScript PPD */
#define PPD_TYPE_PDF 1 /* PDF PPD */
if (!validate_user(job, con, job->username, username, sizeof(username)))
{
- send_http_error(con, HTTP_UNAUTHORIZED, cupsdFindDest(job->dest));
+ send_http_error(con, con->username[0] ? HTTP_FORBIDDEN : HTTP_UNAUTHORIZED,
+ cupsdFindDest(job->dest));
return;
}
if (!validate_user(job, con, job->username, username, sizeof(username)))
{
- send_http_error(con, HTTP_UNAUTHORIZED, cupsdFindDest(job->dest));
+ send_http_error(con, con->username[0] ? HTTP_FORBIDDEN : HTTP_UNAUTHORIZED,
+ cupsdFindDest(job->dest));
return;
}
if (!validate_user(job, con, job->username, username, sizeof(username)))
{
- send_http_error(con, HTTP_UNAUTHORIZED, cupsdFindDest(job->dest));
+ send_http_error(con, con->username[0] ? HTTP_FORBIDDEN : HTTP_UNAUTHORIZED,
+ cupsdFindDest(job->dest));
return;
}
if (!validate_user(job, con, job->username, username, sizeof(username)))
{
- send_http_error(con, HTTP_UNAUTHORIZED, cupsdFindDest(job->dest));
+ send_http_error(con, con->username[0] ? HTTP_FORBIDDEN : HTTP_UNAUTHORIZED,
+ cupsdFindDest(job->dest));
return;
}
if (!validate_user(job, con, job->username, username, sizeof(username)))
{
- send_http_error(con, HTTP_UNAUTHORIZED, cupsdFindDest(job->dest));
+ send_http_error(con, con->username[0] ? HTTP_FORBIDDEN : HTTP_UNAUTHORIZED,
+ cupsdFindDest(job->dest));
return;
}
if (!validate_user(job, con, job->username, username, sizeof(username)))
{
- send_http_error(con, HTTP_UNAUTHORIZED, cupsdFindDest(job->dest));
+ send_http_error(con, con->username[0] ? HTTP_FORBIDDEN : HTTP_UNAUTHORIZED,
+ cupsdFindDest(job->dest));
return;
}
if (!validate_user(job, con, job->username, username, sizeof(username)))
{
- send_http_error(con, HTTP_UNAUTHORIZED, cupsdFindDest(job->dest));
+ send_http_error(con, con->username[0] ? HTTP_FORBIDDEN : HTTP_UNAUTHORIZED,
+ cupsdFindDest(job->dest));
return;
}
if (!validate_user(job, con, job->username, username, sizeof(username)))
{
- send_http_error(con, HTTP_UNAUTHORIZED, cupsdFindDest(job->dest));
+ send_http_error(con, con->username[0] ? HTTP_FORBIDDEN : HTTP_UNAUTHORIZED,
+ cupsdFindDest(job->dest));
return;
}
--- /dev/null
+#!/usr/bin/php -f
+<?php
+
+$fp = popen("zgrep '^\\*Product:' /Library/Printers/PPDs/Contents/Resources/*.gz", "r");
+$files = array();
+$maxlen = 0;
+
+while ($line = fgets($fp, 1024))
+{
+ $data = explode(":", $line);
+ if (array_key_exists($data[0], $files))
+ $files[$data[0]] ++;
+ else
+ $files[$data[0]] = 1;
+
+ $data = explode("\"", $line);
+ if (strlen($data[1]) > $maxlen)
+ $maxlen = strlen($data[1]);
+}
+
+pclose($fp);
+
+arsort($files);
+
+$current_count = 0;
+$current_files = 0;
+
+foreach ($files as $file => $count)
+{
+ if ($current_count == 0)
+ print(basename($file) . " => $count products\n");
+
+ if ($count != $current_count)
+ {
+ if ($current_count != 0)
+ print("$current_files PPDs with $current_count products.\n");
+
+ $current_count = $count;
+ $current_files = 1;
+ }
+ else
+ $current_files ++;
+}
+
+if ($current_count != 0)
+ print("$current_files PPDs with $current_count products.\n");
+
+print("Maximum length of Product string: $maxlen\n");
+
+?>