Skip to content

Commit 8b5fa7b

Browse files
committed
Setup orientation based on /Rotate only.
1 parent 3e02529 commit 8b5fa7b

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

PdfSharpCore/Pdf/PdfPage.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,7 @@ internal PdfPage(PdfDictionary dict)
7272
{
7373
// Set Orientation depending on /Rotate.
7474
int rotate = Elements.GetInteger(InheritablePageKeys.Rotate);
75-
var mediaBox = Elements.GetArray(InheritablePageKeys.MediaBox);
76-
if (Math.Abs((rotate / 90)) % 2 == 1 && mediaBox.Elements.GetReal(3) > mediaBox.Elements.GetReal(2))
75+
if (Math.Abs((rotate / 90)) % 2 == 1)
7776
_orientation = PageOrientation.Landscape;
7877
}
7978

0 commit comments

Comments
 (0)