]> git.ipfire.org Git - thirdparty/cups-filters.git/commitdiff
libcupsfilters: Added bannertopdf() support to universal()
authorTill Kamppeter <till.kamppeter@gmail.com>
Mon, 15 Nov 2021 00:09:56 +0000 (01:09 +0100)
committerTill Kamppeter <till.kamppeter@gmail.com>
Mon, 15 Nov 2021 00:09:56 +0000 (01:09 +0100)
Now the single CUPS filter also prints banners and test pages, needed
for full compatibility with the conventional CUPS filters.

cupsfilters/universal.c

index 11bb9f100c11891ec63fee071691ddbfb6e58272..f09d058ce4c4134918df39cd89bf60d4c51c6352 100644 (file)
@@ -197,6 +197,16 @@ universal(int inputfd,         /* I - File descriptor input stream */
                     "universal: Adding %s to chain", filter->name);
       }
     }
+    else if (!strcmp(input, "application/vnd.cups-pdf-banner"))
+    {
+      filter = malloc(sizeof(filter_filter_in_chain_t));
+      filter->function = bannertopdf;
+      filter->parameters = NULL;
+      filter->name = "bannertopdf";
+      cupsArrayAdd(filter_chain, filter);
+      if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+                  "universal: Adding %s to chain", filter->name);
+    }
   }
   if (((strcmp(input_super, "image") &&
        strcmp(input_type, "vnd.adobe-reader-postscript")) ||