From 7575c7b528f617fd1d8dadb3883f15d8e43810f3 Mon Sep 17 00:00:00 2001 From: Till Kamppeter Date: Sun, 28 Aug 2022 01:04:32 +0200 Subject: [PATCH] libppd: In ppdFilterLoadPPD() let PDF filter log pages when output is PS 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. --- ppd/ppd-filter.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/ppd/ppd-filter.c b/ppd/ppd-filter.c index 06a830998..98cb5d841 100644 --- a/ppd/ppd-filter.c +++ b/ppd/ppd-filter.c @@ -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")) @@ -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 -- 2.47.3