]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
cups/ppd-cache.c: Add cupsUrfSupported to generated PPD (see #804) 805/head
authorAlexander Pevzner <pzz@apevzner.com>
Sun, 22 Oct 2023 19:07:20 +0000 (22:07 +0300)
committerAlexander Pevzner <pzz@apevzner.com>
Sun, 22 Oct 2023 19:37:31 +0000 (22:37 +0300)
It fixes driverless printing on Pantum BM5100ADW Series and, probably,
on many other devices.

- Without this parameter, /usr/lib/cups/filter/universal generates RGB
image/urf even for monochrome printer
- Pantum BM5100ADW Series rejects to print these RGB images with
the "Print job canceled at printer" status.
- Probably, this issue affects many other devices

See #804 for details.

cups/ppd-cache.c

index 40881cd39513d8585d4ab93e950adfe20f4e3c95..7828ea729303454e2417be17a5da8cd761d1cd2a 100644 (file)
@@ -3478,6 +3478,20 @@ _ppdCreateFromIPP2(
   if (!is_apple && !is_pdf && !is_pwg)
     goto bad_ppd;
 
+ /*
+  * cupsUrfSupported
+  */
+  if ((attr = ippFindAttribute(supported, "urf-supported", IPP_TAG_KEYWORD)) != NULL)
+  {
+    cupsFilePuts(fp, "*cupsUrfSupported: \"");
+    for (i = 0, count = ippGetCount(attr); i < count; i ++)
+    {
+      keyword = ippGetString(attr, i, NULL);
+      cupsFilePrintf(fp, "%s%s", keyword, i ? "" : ",");
+    }
+    cupsFilePuts(fp, "\"\n");
+  }
+
  /*
   * PageSize/PageRegion/ImageableArea/PaperDimension
   */