]> git.ipfire.org Git - thirdparty/cups-filters.git/commitdiff
libppd: In ppdFilterLoadPPD() let PDF filter log pages when output is PS
authorTill Kamppeter <till.kamppeter@gmail.com>
Sat, 27 Aug 2022 23:04:32 +0000 (01:04 +0200)
committerTill Kamppeter <till.kamppeter@gmail.com>
Sat, 27 Aug 2022 23:04:32 +0000 (01:04 +0200)
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

index 06a830998ef04f290aad1186fb8bf30226da28a3..98cb5d84131d07a85643e41643c50f4ce1caf219 100644 (file)
@@ -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