]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
The IPP backend incorrectly sent the "job-pages-per-set" attribute to PDF
authorMichael Sweet <michael.r.sweet@gmail.com>
Tue, 18 Jul 2017 14:10:16 +0000 (10:10 -0400)
committerMichael Sweet <michael.r.sweet@gmail.com>
Tue, 18 Jul 2017 14:10:16 +0000 (10:10 -0400)
printers (rdar://33250434)

Need to save the original number of copies and only send "job-pages-per-set"
when the copy count is reset to 1 (as happens when printing with a raster
format...)

CHANGES.md
cups/ppd-cache.c

index eeedf34ecbc2da844f950dceea4538ece229b3d2..483039857304e7c5d0a074dd88408aa13e08b245 100644 (file)
@@ -16,6 +16,8 @@ CHANGES IN CUPS V2.2.5
   an incompatible command-line syntax (Issue #5050)
 - The --enable-libtool configure option requires a path to the libtool program,
   but doesn't document or check for it (Issue #5062)
+- The IPP backend incorrectly sent the "job-pages-per-set" attribute to PDF
+  printers (rdar://33250434)
 
 
 CHANGES IN CUPS V2.2.4
index f41b4387d1c74a0f170e341b01d7c75d4f13059d..8ce02fc19b7d9d23ff2caffdaaeec2a01b0762ba 100644 (file)
@@ -78,6 +78,8 @@ _cupsConvertOptions(
   int          num_finishings = 0,     /* Number of finishing values */
                finishings[10];         /* Finishing enum values */
   ppd_choice_t *choice;                /* Marked choice */
+  int           finishings_copies = copies;
+                                        /* Number of copies for finishings */
 
 
  /*
@@ -366,13 +368,13 @@ _cupsConvertOptions(
   {
     ippAddIntegers(request, IPP_TAG_JOB, IPP_TAG_ENUM, "finishings", num_finishings, finishings);
 
-    if (copies > 1 && (keyword = cupsGetOption("job-impressions", num_options, options)) != NULL)
+    if (copies != finishings_copies && (keyword = cupsGetOption("job-impressions", num_options, options)) != NULL)
     {
      /*
       * Send job-pages-per-set attribute to apply finishings correctly...
       */
 
-      ippAddInteger(request, IPP_TAG_JOB, IPP_TAG_INTEGER, "job-pages-per-set", atoi(keyword) / copies);
+      ippAddInteger(request, IPP_TAG_JOB, IPP_TAG_INTEGER, "job-pages-per-set", atoi(keyword) / finishings_copies);
     }
   }