[
https://issues.apache.org/jira/browse/PDFBOX-1432?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Andreas Lehmkühler resolved PDFBOX-1432.
----------------------------------------
Resolution: Fixed
Fix Version/s: 1.8.0
Assignee: Andreas Lehmkühler
I've applied the pathc in revision 1404593 as proposed.
Thanks for the contribution!
> PDF rotation problem
> --------------------
>
> Key: PDFBOX-1432
> URL: https://issues.apache.org/jira/browse/PDFBOX-1432
> Project: PDFBox
> Issue Type: Bug
> Components: PDModel
> Affects Versions: 1.8.0
> Environment: Ubuntu 11.10 64 bit on Intel® Core™ i5-2430M CPU. Sun
> JDK "1.6.0_30" (build 1.6.0_30-b12) Java HotSpot(TM) 64-Bit Server VM (build
> 20.5-b03, mixed mode).
> Reporter: Ravi Hegde
> Assignee: Andreas Lehmkühler
> Fix For: 1.8.0
>
> Attachments: test.pdf
>
>
> 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 @@
> {
> rotationAngle -= 360;
> }
> - if (rotationAngle != 0)
> + if ((rotationAngle == 90) || (rotationAngle == 270))
> {
> retval = new BufferedImage( heightPx, widthPx, imageType );
> }
> ===================================================================
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira