]> git.ipfire.org Git - thirdparty/cups.git/blobdiff - pdftops/pdftops.cxx
Merge changes from CUPS 1.4svn-r7199.
[thirdparty/cups.git] / pdftops / pdftops.cxx
index 1f1c534be3f64e9660bc42d39dd1e75c136a62c6..a583ae46c50fa792b146ce703436cb67bae4be6a 100644 (file)
@@ -1,26 +1,17 @@
 //
-// "$Id$"
+// "$Id: pdftops.cxx 6649 2007-07-11 21:46:42Z mike $"
 //
 //   PDF to PostScript filter front-end for the Common UNIX Printing
 //   System (CUPS).
 //
+//   Copyright 2007 by Apple Inc.
 //   Copyright 1997-2006 by Easy Software Products.
 //
 //   These coded instructions, statements, and computer programs are the
-//   property of Easy Software Products and are protected by Federal
-//   copyright law.  Distribution and use rights are outlined in the file
-//   "LICENSE.txt" which should have been included with this file.  If this
-//   file is missing or damaged please contact Easy Software Products
-//   at:
-//
-//       Attn: CUPS Licensing Information
-//       Easy Software Products
-//       44141 Airport View Drive, Suite 204
-//       Hollywood, Maryland 20636 USA
-//
-//       Voice: (301) 373-9600
-//       EMail: cups-info@cups.org
-//         WWW: http://www.cups.org
+//   property of Apple Inc. and are protected by Federal copyright
+//   law.  Distribution and use rights are outlined in the file "LICENSE.txt"
+//   which should have been included with this file.  If this file is
+//   file is missing or damaged, see the license at "http://www.cups.org/".
 //
 // Contents:
 //
@@ -35,6 +26,7 @@
 #include <stdlib.h>
 #include <stddef.h>
 #include <cups/string.h>
+#include <cups/i18n.h>
 #include "parseargs.h"
 #include "GString.h"
 #include "gmem.h"
@@ -92,14 +84,15 @@ main(int  argc,                             // I - Number of command-line args
 
   // Make sure we have the right number of arguments for CUPS!
   if (argc < 6 || argc > 7) {
-    fputs("Usage: pdftops job user title copies options [filename]\n", stderr);
+    fprintf(stderr, _("Usage: %s job user title copies options [filename]\n"),
+            argv[0]);
     return (1);
   }
 
   // Copy stdin if needed...
   if (argc == 6) {
     if ((fd = cupsTempFd(tempfile, sizeof(tempfile))) < 0) {
-      perror("ERROR: Unable to copy PDF file");
+      perror(_("ERROR: Unable to copy PDF file"));
       return (1);
     }
 
@@ -279,9 +272,16 @@ main(int  argc,                            // I - Number of command-line args
 
   globalParams = new GlobalParams(buffer);
 
-  globalParams->setPSPaperWidth(width);
-  globalParams->setPSPaperHeight(length);
-  globalParams->setPSImageableArea(left, bottom, right, top);
+  if (fit || globalParams->getPSPaperWidth() > 0)
+  {
+    // Only set paper size and area if we are fitting to the job's
+    // page size or the pdftops.conf file does not contain
+    // "psPaperSize match"...
+    globalParams->setPSPaperWidth(width);
+    globalParams->setPSPaperHeight(length);
+    globalParams->setPSImageableArea(left, bottom, right, top);
+  }
+
   globalParams->setPSDuplex(duplex);
   globalParams->setPSExpandSmaller(fit);
   globalParams->setPSShrinkLarger(fit);
@@ -308,8 +308,7 @@ main(int  argc,                             // I - Number of command-line args
     // write PostScript file
     psOut = new PSOutputDev(psFileName->getCString(), doc->getXRef(),
                             doc->getCatalog(), 1, doc->getNumPages(),
-                           psModePS, 0, 0, 0, 0, gFalse,
-                           cupsGetOption("page-ranges", num_options, options));
+                           psModePS, 0, 0, 0, 0, gFalse, NULL);
     if (psOut->isOk())
       doc->displayPages(psOut, 1, doc->getNumPages(), 72.0, 72.0, 0,
                         gTrue, gFalse, gFalse);
@@ -341,5 +340,5 @@ main(int  argc,                             // I - Number of command-line args
 
 
 //
-// End of "$Id$".
+// End of "$Id: pdftops.cxx 6649 2007-07-11 21:46:42Z mike $".
 //