fprintf(stderr, "PAGE: 1 %d\n", copies_sup ? atoi(argv[4]) : 1);
copies_remaining --;
}
+ else if ((ipp_status == IPP_STATUS_ERROR_DOCUMENT_FORMAT_ERROR || ipp_status == IPP_STATUS_ERROR_DOCUMENT_UNPRINTABLE) &&
+ argc == 6 &&
+ document_format && strcmp(document_format, "image/pwg-raster") && strcmp(document_format, "image/urf"))
+ {
+ /*
+ * Need to reprocess the job as raster...
+ */
+
+ fputs("JOBSTATE: cups-retry-as-raster\n", stderr);
+ if (job_id > 0)
+ cancel_job(http, uri, job_id, resource, argv[2], version);
+
+ goto cleanup;
+ }
else if (ipp_status == IPP_SERVICE_UNAVAILABLE ||
ipp_status == IPP_NOT_POSSIBLE ||
ipp_status == IPP_PRINTER_BUSY)
<dt>--help
</dt>
<dd>Shows program help.
---stop-after-include-error
-Tells <i>ipptool</i> to stop if an error occurs in an included file. Normally <i>ipptool</i> will continue with subsequent tests after the INCLUDE directive.
---version
-Shows the version of <i>ipptool</i> being used.
+</dd>
+<dt>--stop-after-include-error
+</dt>
+<dd>Tells <i>ipptool</i> to stop if an error occurs in an included file. Normally <i>ipptool</i> will continue with subsequent tests after the INCLUDE directive.
+</dd>
+<dt>--version
+</dt>
+<dd>Shows the version of <i>ipptool</i> being used.
</dd>
<dt>-4
</dt>
<h2 class="title"><a name="EXAMPLES">Examples</a></h2>
Get a list of completed jobs for "myprinter":
<pre>
+
ipptool ipp://localhost/printers/myprinter get-completed-jobs.test
</pre>
<p>Send email notifications to "user@example.com" when "myprinter" changes:
<pre>
- ipptool -d recipient=mailto:user@example.com
+
+ ipptool -d recipient=mailto:user@example.com \
ipp://localhost/printers/myprinter create-printer-subscription.test
</pre>
<h2 class="title"><a name="STANDARD_FILES">Standard Files</a></h2>
The following standard files are available:
<pre>
+
color.jpg
create-printer-subscription.test
document-a4.pdf
validate-job.test
</pre>
<h2 class="title"><a name="SEE_ALSO">See Also</a></h2>
-<a href='man-ipptoolfile.html?TOPIC=Man+Pages'>ipptoolfile(5)</a>,
+<a href='man-ipptoolfile.html?TOPIC=Man+Pages'>ipptoolfile(5)</a>, RFC 2911,
<br>
<a href='http://localhost:631/help'>http://localhost:631/help</a>
+<br>
+<a href='http://www.iana.org/assignments/ipp-registrations'>http://www.iana.org/assignments/ipp-registrations</a>
+<br>
+<a href='http://www.pwg.org/ipp'>http://www.pwg.org/ipp</a>
<h2 class="title"><a name="COPYRIGHT">Copyright</a></h2>
-Copyright 2007-2013 by Apple Inc.
+Copyright 2007-2014 by Apple Inc.
</body>
</html>
<dt>ATTR tag attribute-name value(s)
</dt>
<dd>Adds an attribute to the test request. Values are separated by the comma (",")
-character - escape commas using the "" character.
+character - escape commas using the "" character. Common attributes and values are listed in the IANA IPP registry - see references below.
</dd>
<dt>ATTR collection attribute-name { MEMBER tag member-name value(s) ... } [ ... { ... } ]
</dt>
</dd>
</dl>
<h2 class="title"><a name="SEE_ALSO">See Also</a></h2>
-<a href='man-ipptool.html?TOPIC=Man+Pages'>ipptool(1)</a>,
+<a href='man-ipptool.html?TOPIC=Man+Pages'>ipptool(1)</a>, RFC 2911,
<br>
<a href='http://localhost:631/help'>http://localhost:631/help</a>
-
+<br>
+<a href='http://www.iana.org/assignments/ipp-registrations'>http://www.iana.org/assignments/ipp-registrations</a>
+<br>
+<a href='http://www.pwg.org/ipp'>http://www.pwg.org/ipp</a>
<h2 class="title"><a name="COPYRIGHT">Copyright</a></h2>
-Copyright 2007-2013 by Apple Inc.
+Copyright 2007-2014 by Apple Inc.
</body>
</html>
* Local jobs get filtered...
*/
+ mime_type_t *dst = job->printer->filetype;
+ /* Destination file type */
+
snprintf(filename, sizeof(filename), "%s/d%05d-%03d", RequestRoot,
job->id, job->current_file + 1);
if (stat(filename, &fileinfo))
fileinfo.st_size = 0;
- filters = mimeFilter2(MimeDatabase, job->filetypes[job->current_file], (size_t)fileinfo.st_size, job->printer->filetype, &(job->cost));
+ if (job->retry_as_raster)
+ {
+ /*
+ * Need to figure out whether the printer supports image/pwg-raster or
+ * image/urf, and use the corresponding type...
+ */
+
+ char type[MIME_MAX_TYPE]; /* MIME media type for printer */
+
+ snprintf(type, sizeof(type), "%s/image/urf", job->printer->name);
+ if ((dst = mimeType(MimeDatabase, "printer", type)) == NULL)
+ {
+ snprintf(type, sizeof(type), "%s/image/pwg-raster", job->printer->name);
+ dst = mimeType(MimeDatabase, "printer", type);
+ }
+
+ if (dst)
+ cupsdLogJob(job, CUPSD_LOG_DEBUG, "Retrying job as \"%s\".", strchr(dst->type, '/') + 1);
+ else
+ cupsdLogJob(job, CUPSD_LOG_ERROR, "Unable to retry job using a supported raster format.");
+ }
+
+ filters = mimeFilter2(MimeDatabase, job->filetypes[job->current_file], (size_t)fileinfo.st_size, dst, &(job->cost));
if (!filters)
{
cupsdLogJob(job, CUPSD_LOG_DEBUG, "JOBSTATE: %s", message);
- ippSetString(job->attrs, &job->reasons, 0, message);
+ if (!strcmp(message, "cups-retry-as-raster"))
+ job->retry_as_raster = 1;
+ else
+ ippSetString(job->attrs, &job->reasons, 0, message);
}
else if (loglevel == CUPSD_LOG_STATE)
{
*
* Print job definitions for the CUPS scheduler.
*
- * Copyright 2007-2013 by Apple Inc.
+ * Copyright 2007-2014 by Apple Inc.
* Copyright 1997-2007 by Easy Software Products, all rights reserved.
*
* These coded instructions, statements, and computer programs are the
int status; /* Status code from filters */
int tries; /* Number of tries for this job */
int completed; /* cups-waiting-for-job-completed seen */
+ int retry_as_raster;/* Need to retry the job as raster */
char *auth_env[3], /* AUTH_xxx environment variables,
* if any */
*auth_uid; /* AUTH_UID environment variable */