[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[groff] 10/21: [gropdf]: Rotate MediaBox if '-p' arg L-suffixed.
From: |
G. Branden Robinson |
Subject: |
[groff] 10/21: [gropdf]: Rotate MediaBox if '-p' arg L-suffixed. |
Date: |
Fri, 18 Nov 2022 13:47:52 -0500 (EST) |
gbranden pushed a commit to branch master
in repository groff.
commit 3e1c246e22746ce59106c70b2912e9f3472116cc
Author: Deri James <deri@chuzzlewit.myzen.co.uk>
AuthorDate: Wed Nov 16 22:02:49 2022 +0000
[gropdf]: Rotate MediaBox if '-p' arg L-suffixed.
* src/devices/gropdf/gropdf.pl: If the argument to the paper format
option '-p' matches a recognized format but includes a trailing 'L' or
'l' ("legalL" or "a4l", for example), rotate the document's MediaBox.
---
ChangeLog | 7 +++++++
src/devices/gropdf/gropdf.pl | 5 +++++
2 files changed, 12 insertions(+)
diff --git a/ChangeLog b/ChangeLog
index 3c0723d17..2d5fe68ba 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2022-11-16 Deri James <deri@chuzzlewit.myzen.co.uk>
+
+ * src/devices/gropdf/gropdf.pl: If the argument to the paper
+ format option '-p' matches a recognized format but includes a
+ trailing 'L' or 'l' ("legalL" or "a4l", for example), rotate the
+ document's MediaBox.
+
2022-11-16 Deri James <deri@chuzzlewit.myzen.co.uk>
* src/devices/gropdf/gropdf.pl: Fix incorrect hotspot placement
diff --git a/src/devices/gropdf/gropdf.pl b/src/devices/gropdf/gropdf.pl
index 739dad4e4..a2b34c8fd 100644
--- a/src/devices/gropdf/gropdf.pl
+++ b/src/devices/gropdf/gropdf.pl
@@ -318,6 +318,11 @@ elsif (exists($ppsz{$papersz}))
{
@defaultmb=@mediabox=(0,0,$ppsz{$papersz}->[0],$ppsz{$papersz}->[1]);
}
+elsif (substr($papersz,-1) eq 'l' and exists($ppsz{substr($papersz,0,-1)}))
+{
+ # Note 'legal' ends in 'l' but will be caught above
+
@defaultmb=@mediabox=(0,0,$ppsz{substr($papersz,0,-1)}->[1],$ppsz{substr($papersz,0,-1)}->[0]);
+}
my (@dt)=localtime($ENV{SOURCE_DATE_EPOCH} || time);
my $dt=PDFDate(\@dt);
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [groff] 10/21: [gropdf]: Rotate MediaBox if '-p' arg L-suffixed.,
G. Branden Robinson <=