Details
Description
Rotation logic in org.apache.pdfbox.pdmodel.PDPage on line 721 is not right. Page width and height should be swapped only if the rotation is 90 degree or 270 degree. Page width and height should not be swapped for 0, 180 or 360 degree rotation. Condition on line 721 should be
if ((rotationAngle == 90) || (rotationAngle == 270))
Patch:
===================================================================
— PDPage.java (revision 1402957)
+++ PDPage.java (working copy)
@@ -718,7 +718,7 @@
- if (rotationAngle != 0)
+ if ((rotationAngle == 90) || (rotationAngle == 270)) { retval = new BufferedImage( heightPx, widthPx, imageType ); }===================================================================