Skip to content

Commit

Permalink
libppd: In ppdFilterLoadPPD() let PDF filter log pages when output is PS
Browse files Browse the repository at this point in the history
PostScript output is going through the ppdFilterPSToPS() filter to
insert the PostScript code of the option settings into the PostScript
output data stream. The ppdFilterPSToPS() filter only logs pages if
the PPD is a pure PostScript PPD (without "*cupsFilter(2): ..."
lines). If it is not, the PDF filter has to log. This change lets the
PDF filter log the pages in such a case.
  • Loading branch information
tillkamppeter committed Aug 27, 2022
1 parent 0d3db9b commit 7575c7b
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions ppd/ppd-filter.c
Expand Up @@ -855,11 +855,16 @@ ppdFilterLoadPPD(cf_filter_data_t *data) /* I/O - Job and printer data */
/* No filter defined in the PPD
If output data is PDF, cfFilterPDFToPDF() is last
filter (PDF printer) and has to log
If output data is Postscript, ppdFilterPSToPS() should log,
but it only logs with a pure PostScript PPD (no filter definition),
so the PDF filter has to log
If output data is Apple/PWG Raster or PCLm, cfFilter*ToRaster() is
last filter (Driverless IPP printer) and cfFilterPDFToPDF()
also has to log */
if (strcasestr(data->final_content_type, "/pdf") ||
strcasestr(data->final_content_type, "/vnd.cups-pdf") ||
strcasestr(data->final_content_type, "/postscript") ||
strcasestr(data->final_content_type, "/vnd.cups-postscript") ||
strcasestr(data->final_content_type, "/pwg-raster") ||
strcasestr(data->final_content_type, "/urf") ||
strcasestr(data->final_content_type, "/pclm"))
Expand Down Expand Up @@ -900,6 +905,13 @@ ppdFilterLoadPPD(cf_filter_data_t *data) /* I/O - Job and printer data */
delegate the logging to the PDF filter */
page_logging = 1;
}
else if (!strncasecmp(lastfilter + strlen(lastfilter) - 4, "tops", 4))
{
/* Something-to PostScript filter is the last filter, so output is
PostScript but these filters only log with pure PostScript PPD
(no filter definition), so the PDF filter has to log */
page_logging = 1;
}
else if (!strcasecmp(lastfilter, "hpps"))
{
/* hpps is last filter, hpps is part of HPLIP and it is a bug that
Expand Down

0 comments on commit 7575c7b

Please sign in to comment.