Uploaded image for project: 'PDFBox'
  1. PDFBox
  2. PDFBOX-1432

PDF rotation problem

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.8.0
    • 1.8.0
    • PDModel
    • None
    • 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).

    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 @@

      { rotationAngle -= 360; }
      • if (rotationAngle != 0)
        + if ((rotationAngle == 90) || (rotationAngle == 270)) { retval = new BufferedImage( heightPx, widthPx, imageType ); }

        ===================================================================

      Attachments

        1. test.pdf
          1.91 MB
          Ravi Hegde

        Activity

          People

            lehmi Andreas Lehmkühler
            ravihegde@hotmail.com Ravi Hegde
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: