*ap_page_size; /* AP_FIRSTPAGE_PageSize value */
int collate, /* Collate copies? */
emit_jcl, /* Emit JCL commands? */
- fitplot; /* Fit pages to media */
+ fit_to_page; /* Fit pages to media */
const char *input_slot, /* InputSlot value */
*manual_feed, /* ManualFeed value */
*media_color, /* MediaColor value */
puts("%%Trailer");
printf("%%%%Pages: %d\n", cupsArrayCount(doc->pages));
- if (doc->number_up > 1 || doc->fitplot)
+ if (doc->number_up > 1 || doc->fit_to_page)
printf("%%%%BoundingBox: %.0f %.0f %.0f %.0f\n",
PageLeft, PageBottom, PageRight, PageTop);
else
memcpy(bounding_box, doc->bounding_box,
sizeof(bounding_box));
}
- else if (doc->number_up == 1 && !doc->fitplot && Orientation)
+ else if (doc->number_up == 1 && !doc->fit_to_page && Orientation)
{
int temp_bbox[4]; /* Temporary bounding box */
* %%IncludeFeature: *MainKeyword OptionKeyword
*/
- if (doc->number_up == 1 &&!doc->fitplot)
+ if (doc->number_up == 1 &&!doc->fit_to_page)
pageinfo->num_options = include_feature(ppd, line,
pageinfo->num_options,
&(pageinfo->options));
{
feature = 1;
- if (doc->number_up > 1 || doc->fitplot)
+ if (doc->number_up > 1 || doc->fit_to_page)
continue;
}
else if (!strncmp(line, "%%EndFeature", 12))
{
feature = 0;
- if (doc->number_up > 1 || doc->fitplot)
+ if (doc->number_up > 1 || doc->fit_to_page)
continue;
}
else if (!strncmp(line, "%%IncludeFeature:", 17))
if (line[0] != '%' && !feature)
break;
- if (!feature || (doc->number_up == 1 && !doc->fitplot))
+ if (!feature || (doc->number_up == 1 && !doc->fit_to_page))
doc_write(doc, line, linelen);
}
* %%IncludeFeature: *MainKeyword OptionKeyword
*/
- if (doc->number_up == 1 && !doc->fitplot)
+ if (doc->number_up == 1 && !doc->fit_to_page)
num_options = include_feature(ppd, line, num_options, &options);
}
else if (strncmp(line, "%%BeginSetup", 12))
fprintf(stderr, "DEBUG: Wrote %d pages...\n", number);
printf("%%%%Pages: %d\n", number);
- if (doc->number_up > 1 || doc->fitplot)
+ if (doc->number_up > 1 || doc->fit_to_page)
printf("%%%%BoundingBox: %.0f %.0f %.0f %.0f\n",
PageLeft, PageBottom, PageRight, PageTop);
else
ppd_option_t *option; /* PPD option */
ppd_choice_t *choice; /* PPD choice */
const char *content_type; /* Original content type */
+ int max_copies; /* Maximum number of copies supported */
/*
doc->emit_jcl = 1;
/*
- * fitplot/fit-to-page/ipp-attribute-fidelity
+ * fit-to-page/ipp-attribute-fidelity
*
* (Only for original PostScript content)
*/
if (!_cups_strcasecmp(content_type, "application/postscript"))
{
- if ((val = cupsGetOption("fitplot", num_options, options)) != NULL &&
+ if ((val = cupsGetOption("fit-to-page", num_options, options)) != NULL &&
!_cups_strcasecmp(val, "true"))
- doc->fitplot = 1;
- else if ((val = cupsGetOption("fit-to-page", num_options, options)) != NULL &&
- !_cups_strcasecmp(val, "true"))
- doc->fitplot = 1;
+ doc->fit_to_page = 1;
else if ((val = cupsGetOption("ipp-attribute-fidelity", num_options,
options)) != NULL &&
!_cups_strcasecmp(val, "true"))
- doc->fitplot = 1;
+ doc->fit_to_page = 1;
}
/*
* Now figure out if we have to force collated copies, etc.
*/
- if (ppd && ppd->manual_copies && Duplex && doc->copies > 1)
+ if ((attr = ppdFindAttr(ppd, "cupsMaxCopies", NULL)) != NULL)
+ max_copies = atoi(attr->value);
+ else if (ppd && ppd->manual_copies)
+ max_copies = 1;
+ else
+ max_copies = 9999;
+
+ if (doc->copies > max_copies)
+ doc->collate = 1;
+ else if (ppd && ppd->manual_copies && Duplex && doc->copies > 1)
{
/*
* Force collated copies when printing a duplexed document to
doc->slow_collate = 1;
- if ((choice = ppdFindMarkedChoice(ppd, "Collate")) != NULL &&
+ if (doc->copies <= max_copies &&
+ (choice = ppdFindMarkedChoice(ppd, "Collate")) != NULL &&
!_cups_strcasecmp(choice->choice, "True"))
{
/*
pagew = PageRight - PageLeft;
pagel = PageTop - PageBottom;
- if (doc->fitplot)
+ if (doc->fit_to_page)
{
bboxx = bounding_box[0];
bboxy = bounding_box[1];
doc_printf(doc, "%.1f 0.0 translate -1 1 scale\n", PageWidth);
/*
- * Offset and scale as necessary for fitplot/fit-to-page/number-up...
+ * Offset and scale as necessary for fit_to_page/fit-to-page/number-up...
*/
if (Duplex && doc->number_up > 1 && ((number / doc->number_up) & 1))
doc_printf(doc, "%.1f %.1f translate\n", PageWidth - PageRight, PageBottom);
- else if (doc->number_up > 1 || doc->fitplot)
+ else if (doc->number_up > 1 || doc->fit_to_page)
doc_printf(doc, "%.1f %.1f translate\n", PageLeft, PageBottom);
switch (doc->number_up)
{
default :
- if (doc->fitplot)
+ if (doc->fit_to_page)
{
w = pagew;
l = w * bboxl / bboxw;
doc_puts(doc, "grestore\n");
}
- if (doc->fitplot)
+ if (doc->fit_to_page)
{
/*
* Offset the page by its bounding box...
-bounding_box[1]);
}
- if (doc->fitplot || doc->number_up > 1)
+ if (doc->fit_to_page || doc->number_up > 1)
{
/*
* Clip the page to the page's bounding box...