diff --git a/cupsfilters/raster.c b/cupsfilters/raster.c index 316c86cc7..93975d3d2 100644 --- a/cupsfilters/raster.c +++ b/cupsfilters/raster.c @@ -374,12 +374,21 @@ cfRasterPrepareHeader(cups_page_header_t *h, // I - Raster header else if (size_name_buf[0]) _strlcpy(h->cupsPageSizeName, size_name_buf, sizeof(h->cupsPageSizeName)); - if (data->printer_attrs != NULL || - data->job_attrs != NULL || - final_outformat != CF_FILTER_OUT_FORMAT_PDF || - data->content_type == NULL || - strcmp(data->content_type, "application/postscript")) + log(ld, CF_LOGLEVEL_DEBUG, "Format of the input document: %s", data->content_type); + if (data->content_type == NULL || + (strcmp(data->content_type, "application/postscript") && + strcmp(data->content_type, "application/vnd.cups-postscript") && + strcmp(data->content_type, "application/pdf") && + strcmp(data->content_type, "application/vnd.cups-pdf") && + strcmp(data->content_type, "application/vnd.cups-raster") && + strcmp(data->content_type, "image/pwg-raster") && + strcmp(data->content_type, "image/urf"))) { + // The input format of the document does not define the sizes of the + // input pages in absolute dimensions, so if no output page size + // is defined, fall back to US Letter + log(ld, CF_LOGLEVEL_DEBUG, + "Document's input format does not provide absolute size dimensions for each page, falling back to US Letter if no output page size is provided."); cfSetPageDimensionsToDefault(&(dimensions[0]), &(dimensions[1]), &(margins[0]), &(margins[1]), &(margins[2]), &(margins[3]), @@ -388,7 +397,7 @@ cfRasterPrepareHeader(cups_page_header_t *h, // I - Raster header else { log(ld, CF_LOGLEVEL_DEBUG, - "Postscript to PDF and no attributes: not setting page size."); + "Document's input format provides absolute size dimensions for each page, using these if no output page size is provided."); } if (!cupsrasterheader)