Tim Waugh 7bb195
diff -up cups-1.4.3/filter/texttops.c.texttops-rotate-page cups-1.4.3/filter/texttops.c
Tim Waugh 7bb195
--- cups-1.4.3/filter/texttops.c.texttops-rotate-page	2008-11-06 16:42:18.000000000 +0000
Tim Waugh 7bb195
+++ cups-1.4.3/filter/texttops.c	2010-05-18 16:42:23.669940884 +0100
Tim Waugh 7bb195
@@ -97,6 +97,13 @@ WritePage(void)
Tim Waugh 7bb195
 
Tim Waugh 7bb195
   puts("gsave");
Tim Waugh 7bb195
 
Tim Waugh 7bb195
+  /* If we're opereating in Landscape (Orientation == 1 or Orientation == 3)
Tim Waugh 7bb195
+     then rotate and translate the page */
Tim Waugh 7bb195
+  if ( Orientation & 1 ) {
Tim Waugh 7bb195
+    printf ("%d rotate\n", (Orientation & 3) * 90 );
Tim Waugh 7bb195
+    printf("0 %.0f neg translate\n", PageLength);
Tim Waugh 7bb195
+  }
Tim Waugh 7bb195
+
Tim Waugh 7bb195
   if (PrettyPrint)
Tim Waugh 7bb195
     printf("%d H\n", NumPages);
Tim Waugh 7bb195
 
Tim Waugh 7bb195
@@ -212,7 +219,7 @@ WriteProlog(const char *title,		/* I - T
Tim Waugh 7bb195
 
Tim Waugh 7bb195
   puts("%!PS-Adobe-3.0");
Tim Waugh 7bb195
   printf("%%%%BoundingBox: 0 0 %.0f %.0f\n", PageWidth, PageLength);
Tim Waugh 7bb195
-  printf("%%cupsRotation: %d\n", (Orientation & 3) * 90);
Tim Waugh 7bb195
+  puts("%cupsRotation: 0");
Tim Waugh 7bb195
   puts("%%Creator: texttops/" CUPS_SVERSION);
Tim Waugh 7bb195
   printf("%%%%CreationDate: %s\n", curdate);
Tim Waugh 7bb195
   WriteTextComment("Title", title);
Tim Waugh 7bb195
@@ -549,6 +556,8 @@ WriteProlog(const char *title,		/* I - T
Tim Waugh 7bb195
   puts("%%EndComments");
Tim Waugh 7bb195
 
Tim Waugh 7bb195
   puts("%%BeginProlog");
Tim Waugh 7bb195
+  printf("%%%%Orientation: %s\n", 
Tim Waugh 7bb195
+         Orientation & 1 ? "Landscape" : "Portrait");
Tim Waugh 7bb195
 
Tim Waugh 7bb195
  /*
Tim Waugh 7bb195
   * Download any missing fonts...