]> git.ipfire.org Git - thirdparty/cups-filters.git/commitdiff
pdftopdf: Fix orientation-requested = 0
authorTill Kamppeter <till.kamppeter@gmail.com>
Thu, 3 Feb 2022 19:01:56 +0000 (16:01 -0300)
committerTill Kamppeter <till.kamppeter@gmail.com>
Thu, 3 Feb 2022 19:01:56 +0000 (16:01 -0300)
CUPS often adds "orientation-requested=0" to the options in the
filter/backend command line, meaning automatic selection. pdftopdf()
did not support this value and therefore did not do the correct
settings making margins of rotated landscape pages not be done
correctly.

(manually backported commit 947634e296644f2af4e92871e72788579a70253f)

NEWS
filter/pdftopdf/pdftopdf.cc

diff --git a/NEWS b/NEWS
index 0d0ce186e7e938899b3ce7189896db08a0e8d4e3..d4dd5e212cdf64bd69aa502f723176f1441709ec 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -3,6 +3,8 @@ NEWS - OpenPrinting CUPS Filters v1.28.11 - 2022-01-15
 
 CHANGES IN V1.28.12
 
+       - pdftopdf: Fix orientation-requested = 0. Consider
+         this as "automatic selection and not as error.
        - pdftopdf: Fixed all combinations of print-scaling and
          number-up for printers with asymmetric margins (top !=
          bottom or left != right) and for input files containing
index b065eb614fe250e3423b12bc922024cb8edd9064..c6f9d500496ecf74899854d95ad74e6e77690558 100644 (file)
@@ -376,7 +376,10 @@ void getParameters(ppd_file_t *ppd,int num_options,cups_option_t *options,Proces
      *   3: 0 degrees,  4: 90 degrees,  5: -90 degrees,  6: 180 degrees
      */
     if ((ipprot<3)||(ipprot>6)) {
-      error("Bad value (%d) for orientation-requested, using 0 degrees",ipprot);
+      if (ipprot)
+       error("Bad value (%d) for orientation-requested, using 0 degrees",
+             ipprot);
+      param.noOrientation = true;
     } else {
       static const Rotation ipp2rot[4]={ROT_0, ROT_90, ROT_270, ROT_180};
       param.orientation=ipp2rot[ipprot-3];