]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
Update PDF filter to support new Poppler option to preserve page sizes in PDF
authormike <mike@7a7537e8-13f0-0310-91df-b6672ffda945>
Fri, 6 May 2011 16:50:15 +0000 (16:50 +0000)
committermike <mike@7a7537e8-13f0-0310-91df-b6672ffda945>
Fri, 6 May 2011 16:50:15 +0000 (16:50 +0000)
files when the user has not selected a particular media size (STR #3689)

git-svn-id: svn+ssh://src.apple.com/svn/cups/cups.org/trunk@9746 7a7537e8-13f0-0310-91df-b6672ffda945

CHANGES.txt
README.txt
config-scripts/cups-pdf.m4
config.h.in
filter/pdftops.c

index 8fcf447801752c69d92240845c8736f3c5b32420..4d21896f8f1c3303c2df220c811678ff32ab54f1 100644 (file)
@@ -1,8 +1,11 @@
-CHANGES.txt - 2011-03-31
+CHANGES.txt - 2011-05-06
 ------------------------
 
 CHANGES IN CUPS V1.5b1
 
+       - Update PDF filter to support new Poppler option to preserve page sizes
+         in PDF files when the user has not selected a particular media size
+         (STR #3689)
        - Added new PWG Raster filter for IPP Everywhere printer support.
        - Added printer-uuid attribute.
        - Added support for the cupsSingleFile PPD keyword.
index 8bfcbd4dc3318aaca812a54879df7adae6c5a5da..3e9c6d8b5beadc96d78aa3340a4a951f974bcba0 100644 (file)
@@ -1,4 +1,4 @@
-README - CUPS v1.5svn - 2011-01-03
+README - CUPS v1.5svn - 2011-05-06
 ----------------------------------
 
 Looking for compile instructions?  Read the file "INSTALL.txt"
index ac19697e0b13c601f92d7b8ba61b744fab63c1ec..4de2731769f69660f8713a5ef924752aa774c374 100644 (file)
@@ -79,6 +79,12 @@ case "x$with_pdftops" in
        ;;
 esac
 
+if test "x$CUPS_PDFTOPS" != x; then
+       if `$CUPS_PDFTOPS -h 2>&1 | grep -q -- -origpagesizes 2>/dev/null`; then
+               AC_DEFINE(HAVE_PDFTOPS_WITH_ORIGPAGESIZES)
+       fi
+fi
+
 AC_DEFINE_UNQUOTED(CUPS_PDFTOPS, "$CUPS_PDFTOPS")
 AC_DEFINE_UNQUOTED(CUPS_GHOSTSCRIPT, "$CUPS_GHOSTSCRIPT")
 AC_SUBST(PDFTOPS)
index 9e725c55ef133e05328116e0cb738dcb1ce16f6b..08fa1eb0b6207aa0e415a2ae012bb3854866e0a8 100644 (file)
  */
 
 #undef HAVE_PDFTOPS
+#undef HAVE_PDFTOPS_WITH_ORIGPAGESIZES
 #define CUPS_PDFTOPS   "/usr/bin/pdftops"
 
 
index 3f0bf338da1aacfc89f53ab0b45ca374133d46e8..106a80157d9fcd0a8a635661a88d2601391b704c 100644 (file)
@@ -341,7 +341,8 @@ main(int  argc,                             /* I - Number of command-line args */
            strcasecmp(val, "false") != 0)
          orientation = 1;
       }
-      else if ((val = cupsGetOption("orientation-requested", num_options, options)) != NULL)
+      else if ((val = cupsGetOption("orientation-requested", num_options,
+                                    options)) != NULL)
       {
        /*
        * Map IPP orientation values to 0 to 3:
@@ -395,6 +396,17 @@ main(int  argc,                            /* I - Number of command-line args */
       pdf_argv[pdf_argc++] = pdf_height;
 #endif /* HAVE_PDFTOPS */
     }
+#if defined(HAVE_PDFTOPS) && defined(HAVE_PDFTOPS_WITH_ORIGPAGESIZES)
+    else
+    {
+     /*
+      *  Use the page sizes of the original PDF document, this way documents
+      *  which contain pages of different sizes can be printed correctly
+      */
+
+      pdf_argv[pdf_argc++] = (char *)"-origpagesizes";
+    }
+#endif /* HAVE_PDFTOPS && HAVE_PDFTOPS_WITH_ORIGPAGESIZES */
   }
 
 #ifdef HAVE_PDFTOPS