Skip to content

Commit 263d29b

Browse files
LodrKumquatars18wrw
authored andcommitted
Make <page-size> ledger portrait-oriented
DEVSIX-1495 Autoported commit. Original commit hash: [9adcd68]
1 parent 48b7b6e commit 263d29b

File tree

4 files changed

+8
-4
lines changed

4 files changed

+8
-4
lines changed

itext.tests/itext.html2pdf.tests/itext/html2pdf/attach/impl/layout/PageSizeParserTest.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ public virtual void SimpleA4Test() {
5656

5757
[NUnit.Framework.Test]
5858
public virtual void SimpleLedgerTest() {
59-
PageSize expected = PageSize.LEDGER;
59+
PageSize expected = PageSize.LEDGER.Rotate();
6060
PageSize actual = PageSizeParser.FetchPageSize("ledger", 10, 10, PageSize.A0);
6161
AssertSizesAreSame(expected, actual);
6262
}
Binary file not shown.

itext/itext.html2pdf/itext/html2pdf/attach/impl/layout/PageSizeParser.cs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,10 +66,14 @@ static PageSizeParser() {
6666
pageSizeConstants.Put("jis-b4", new PageSize(729, 1032));
6767
pageSizeConstants.Put("letter", PageSize.LETTER);
6868
pageSizeConstants.Put("legal", PageSize.LEGAL);
69-
pageSizeConstants.Put("ledger", PageSize.LEDGER);
69+
/* according to CSS Paged Media Module Level 3 Editor’s Draft:
70+
"ledger - Equivalent to the size of North American ledger: 11 inches wide by 17 inches high"
71+
See https://www.w3.org/TR/css-page-3/
72+
That makes this <page-size> portrait-oriented, i.e. rotated PageSize.LEDGER.
73+
*/
74+
pageSizeConstants.Put("ledger", PageSize.LEDGER.Rotate());
7075
}
7176

72-
// TODO may be use here TABLOID? based on w3c tests, ledger in html is interpreted as portrait-oriented page
7377
/// <summary>Fetch the page size.</summary>
7478
/// <param name="pageSizeStr">the name of the page size ("a4", "letter",...)</param>
7579
/// <param name="em">the em value</param>

port-hash

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0d5591e0170c2a468fe1c96649051f9adb4f7c6d
1+
9adcd68b4c42e6cad203f9e30546535afbf33d7f

0 commit comments

Comments
 (0)