diff --git a/src/UglyToad.PdfPig/Content/PageRotationDegrees.cs b/src/UglyToad.PdfPig/Content/PageRotationDegrees.cs index 5d4c0fb9..c2406931 100644 --- a/src/UglyToad.PdfPig/Content/PageRotationDegrees.cs +++ b/src/UglyToad.PdfPig/Content/PageRotationDegrees.cs @@ -47,6 +47,11 @@ /// Rotation in degrees clockwise. public PageRotationDegrees(int rotation) { + while (rotation >= 360) + { + rotation -= 360; + } + if (rotation != 0 && rotation != 90 && rotation != 180 && rotation != 270) { throw new ArgumentOutOfRangeException(nameof(rotation), $"Rotation must be 0, 90, 180 or 270. Got: {rotation}.");