Index: pdftops/PSOutputDev.cxx
===================================================================
--- pdftops/PSOutputDev.cxx	(revision 7725)
+++ pdftops/PSOutputDev.cxx	(working copy)
@@ -1166,8 +1166,6 @@
 
   if (width > height && width > imgWidth) cups_rotate = 90;
 
-  writePSFmt("%%cupsRotation: %d\n", cups_rotate);
-
   writePSFmt("%%Producer: xpdf/pdftops %s\n", xpdfVersion);
   xref->getDocInfo(&info);
   if (info.isDict() && info.dictLookup("Creator", &obj1)->isString()) {
@@ -2519,8 +2517,9 @@
     } else {
       rotate = (360 - state->getRotate()) % 360;
 
-      fprintf(stderr, "DEBUG: Page rotate=%d, width=%d, height=%d, imgWidth=%d, imgHeight=%d\n",
-              state->getRotate(), width, height, imgWidth, imgHeight);
+      fprintf(stderr, "DEBUG: getRotate=%d, rotate=%d, width=%d, height=%d, "
+                      "imgWidth=%d, imgHeight=%d\n",
+              state->getRotate(), rotate, width, height, imgWidth, imgHeight);
 
       if (rotate == 0 || rotate == 180) {
 	if (width > height && width > imgWidth) {
@@ -2539,6 +2538,9 @@
       }
     }
 
+    fprintf(stderr, "DEBUG: Using rotate=%d, width=%d, height=%d, imgWidth=%d, imgHeight=%d\n",
+	    rotate, width, height, imgWidth, imgHeight);
+
     writePSFmt("%%%%PageOrientation: %s\n",
 	       landscape ? "Landscape" : "Portrait");
     writePS("pdfStartPage\n");
Index: pdftops/pdftops.cxx
===================================================================
--- pdftops/pdftops.cxx	(revision 7725)
+++ pdftops/pdftops.cxx	(working copy)
@@ -4,7 +4,7 @@
 //   PDF to PostScript filter front-end for the Common UNIX Printing
 //   System (CUPS).
 //
-//   Copyright 2007 by Apple Inc.
+//   Copyright 2007-2008 by Apple Inc.
 //   Copyright 1997-2006 by Easy Software Products.
 //
 //   These coded instructions, statements, and computer programs are the
@@ -70,8 +70,6 @@
   char		buffer[8192];		// Copy buffer
   int		bytes;			// Bytes copied
   int		width, length;		// Size in points
-  int		left, bottom, right, top;
-					// Imageable area in points
   int		orientation;		// Orientation
   int		temp;			// Temporary var
   int		duplex;			// Duplex the output?
@@ -110,10 +108,6 @@
   }
 
   // Default to "Universal" size - min of A4 and Letter...
-  left   = 0;
-  bottom = 0;
-  right  = 595;
-  top    = 792;
   width  = 595;
   length = 792;
   level  = psLevel2;
@@ -132,10 +126,6 @@
 
     if ((size = ppdPageSize(ppd, NULL)) != NULL)
     {
-      left   = (int)size->left;
-      bottom = (int)size->bottom;
-      right  = (int)size->right;
-      top    = (int)size->top;
       width  = (int)size->width;
       length = (int)size->length;
     }
@@ -172,49 +162,11 @@
   switch (orientation & 3)
   {
     case 0 : /* Portait */
-        break;
-
-    case 1 : /* Landscape */
-	temp   = left;
-	left   = bottom;
-	bottom = temp;
-
-	temp   = right;
-	right  = top;
-	top    = temp;
-
-	temp   = width;
-	width  = length;
-	length = temp;
-	break;
-
     case 2 : /* Reverse Portrait */
-	temp   = width - left;
-	left   = width - right;
-	right  = temp;
-
-	temp   = length - bottom;
-	bottom = length - top;
-	top    = temp;
         break;
 
+    case 1 : /* Landscape */
     case 3 : /* Reverse Landscape */
-	temp   = width - left;
-	left   = width - right;
-	right  = temp;
-
-	temp   = length - bottom;
-	bottom = length - top;
-	top    = temp;
-
-	temp   = left;
-	left   = bottom;
-	bottom = temp;
-
-	temp   = right;
-	right  = top;
-	top    = temp;
-
 	temp   = width;
 	width  = length;
 	length = temp;
@@ -277,9 +229,13 @@
     // 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"...
+
+    fprintf(stderr, "DEBUG: Setting paper dimensions to %dx%d!\n", width,
+            length);
+
     globalParams->setPSPaperWidth(width);
     globalParams->setPSPaperHeight(length);
-    globalParams->setPSImageableArea(left, bottom, right, top);
+    globalParams->setPSImageableArea(0, 0, width, length);
   }
 
   globalParams->setPSDuplex(duplex);
