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

PDFPrinter problem with landscape and rotated pages

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.0.0
    • 2.0.0
    • Rendering
    • None

    Description

      PDFPrinter does not correctly print landscape or rotated pages, there is code which attempts to do both these things, however the results is wrong. There are three main issues:

      • the centering code does*not* center the image correctly because it assumes that imageableArea is the Graphics2D origin, but it is actually the page margin size and the Graphics2D origin remains the physical top-left edge of the paper.
      • auto portrait/landcape is actually sets the imageableArea, so it is actually setting the page margins, instead of the Graphics2D origin. This is actually overwriting the user's desired margins as well as placing the image incorrectly on the page.
      • the Page dictionary "Rotate" key is not taken into account, so rotated pages appear incorrectly.

      Attachments

        1. usps.pdf
          216 kB
          John Hewson

        Issue Links

          Activity

            People

              jahewson John Hewson
              jahewson John Hewson
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: