Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions cups/encode.c
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,8 @@ static const _ipp_option_t ipp_options[] =
{ 0, "ppi-default", IPP_TAG_INTEGER, IPP_TAG_PRINTER },
{ 0, "prettyprint", IPP_TAG_BOOLEAN, IPP_TAG_JOB },
{ 0, "prettyprint-default", IPP_TAG_BOOLEAN, IPP_TAG_PRINTER },
{ 0, "print-as-raster", IPP_TAG_BOOLEAN, IPP_TAG_JOB },
{ 0, "print-as-raster-default", IPP_TAG_BOOLEAN, IPP_TAG_PRINTER },
{ 0, "print-color-mode", IPP_TAG_KEYWORD, IPP_TAG_JOB,
IPP_TAG_DOCUMENT },
{ 0, "print-color-mode-default", IPP_TAG_KEYWORD, IPP_TAG_PRINTER },
Expand Down
3 changes: 3 additions & 0 deletions doc/help/man-lp.html
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,9 @@ <h3 id="lp-1.options.common-job-options">Common Job Options</h3>
</p>
<p style="margin-left: 2.5em; text-indent: -2.5em;"><strong>-o orientation-requested=6</strong><br>
Prints the job in reverse portrait (rotated 180 degrees).
</p>
<p style="margin-left: 2.5em; text-indent: -2.5em;"><strong>-o print-as-raster</strong><br>
Prints the job as raster.
</p>
<p style="margin-left: 2.5em; text-indent: -2.5em;"><strong>-o print-quality=3</strong><br>
</p>
Expand Down
3 changes: 3 additions & 0 deletions man/lp.1
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,9 @@ Prints the job in landscape (rotated 90 degrees clockwise).
\fB\-o orientation\-requested=6\fR
Prints the job in reverse portrait (rotated 180 degrees).
.TP 5
\fB\-o print-as-raster\fR
Prints the job as raster.
.TP 5
\fB\-o print\-quality=3\fR
.TP 5
\fB\-o print\-quality=4\fR
Expand Down
3 changes: 3 additions & 0 deletions scheduler/ipp.c
Original file line number Diff line number Diff line change
Expand Up @@ -1517,6 +1517,9 @@ add_job(cupsd_client_t *con, /* I - Client connection */
return (NULL);
}

if (ippGetBoolean(ippFindAttribute(con->request, "print-as-raster", IPP_TAG_BOOLEAN), 0))
job->print_as_raster = 1;

job->dtype = printer->type & (CUPS_PTYPE_CLASS | CUPS_PTYPE_REMOTE);
job->attrs = con->request;
job->dirty = 1;
Expand Down
8 changes: 4 additions & 4 deletions scheduler/job.c
Original file line number Diff line number Diff line change
Expand Up @@ -579,7 +579,7 @@ cupsdContinueJob(cupsd_job_t *job) /* I - Job */

cupsRWLockWrite(&MimeDatabase->lock);

if (job->retry_as_raster)
if (job->print_as_raster)
{
/*
* Need to figure out whether the printer supports image/pwg-raster or
Expand All @@ -596,9 +596,9 @@ cupsdContinueJob(cupsd_job_t *job) /* I - Job */
}

if (dst)
cupsdLogJob(job, CUPSD_LOG_DEBUG, "Retrying job as \"%s\".", strchr(dst->type, '/') + 1);
cupsdLogJob(job, CUPSD_LOG_DEBUG, "%s job as \"%s\".", job->print_as_raster > 0 ? "Printing" : "Retrying", strchr(dst->type, '/') + 1);
else
cupsdLogJob(job, CUPSD_LOG_ERROR, "Unable to retry job using a supported raster format.");
cupsdLogJob(job, CUPSD_LOG_ERROR, "Unable to print job using a supported raster format.");
}

filters = mimeFilter2(MimeDatabase, job->filetypes[job->current_file], (size_t)fileinfo.st_size, dst, &(job->cost));
Expand Down Expand Up @@ -5247,7 +5247,7 @@ update_job(cupsd_job_t *job) /* I - Job to check */
cupsdLogJob(job, CUPSD_LOG_DEBUG, "JOBSTATE: %s", message);

if (!strcmp(message, "cups-retry-as-raster"))
job->retry_as_raster = 1;
job->print_as_raster = -1;
else
ippSetString(job->attrs, &job->reasons, 0, message);
}
Expand Down
3 changes: 2 additions & 1 deletion scheduler/job.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,8 @@ struct cupsd_job_s /**** Job request ****/
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 */
int print_as_raster;
/* Need to print the job as raster */
char *auth_env[3], /* AUTH_xxx environment variables,
* if any */
*auth_uid; /* AUTH_UID environment variable */
Expand Down
3 changes: 3 additions & 0 deletions scheduler/printers.c
Original file line number Diff line number Diff line change
Expand Up @@ -578,6 +578,9 @@ cupsdCreateCommonData(void)
/* pdl-override-supported */
ippAddString(CommonData, IPP_TAG_PRINTER, IPP_CONST_TAG(IPP_TAG_KEYWORD), "pdl-override-supported", NULL, "attempted");

/* print-as-raster-supported */
ippAddBoolean(CommonData, IPP_TAG_PRINTER, "print-as-raster-supported", 1);

/* print-scaling-supported */
ippAddStrings(CommonData, IPP_TAG_PRINTER, IPP_CONST_TAG(IPP_TAG_KEYWORD), "print-scaling-supported", sizeof(print_scaling) / sizeof(print_scaling[0]), NULL, print_scaling);

Expand Down
Loading