-
Notifications
You must be signed in to change notification settings - Fork 19
/
Copy pathcups-texttops-rotate-page.patch
35 lines (29 loc) · 1.22 KB
/
cups-texttops-rotate-page.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
diff -up cups-1.3.7/filter/texttops.c.texttops-rotate-page cups-1.3.7/filter/texttops.c
--- cups-1.3.7/filter/texttops.c.texttops-rotate-page 2010-05-18 16:55:26.361941942 +0100
+++ cups-1.3.7/filter/texttops.c 2010-05-18 16:55:42.728941816 +0100
@@ -97,6 +97,13 @@ WritePage(void)
puts("gsave");
+ /* If we're opereating in Landscape (Orientation == 1 or Orientation == 3)
+ then rotate and translate the page */
+ if ( Orientation & 1 ) {
+ printf ("%d rotate\n", (Orientation & 3) * 90 );
+ printf("0 %.0f neg translate\n", PageLength);
+ }
+
if (PrettyPrint)
printf("%d H\n", NumPages);
@@ -212,7 +219,7 @@ WriteProlog(const char *title, /* I - T
puts("%!PS-Adobe-3.0");
printf("%%%%BoundingBox: 0 0 %.0f %.0f\n", PageWidth, PageLength);
- printf("%%cupsRotation: %d\n", (Orientation & 3) * 90);
+ puts("%cupsRotation: 0");
puts("%%Creator: texttops/" CUPS_SVERSION);
printf("%%%%CreationDate: %s\n", curdate);
WriteTextComment("Title", title);
@@ -721,6 +728,8 @@ WriteProlog(const char *title, /* I - T
puts("%%EndComments");
puts("%%BeginProlog");
+ printf("%%%%Orientation: %s\n",
+ Orientation & 1 ? "Landscape" : "Portrait");
/*
* Download any missing fonts...