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

Allowing Rectangles with additional elements

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 1.8.15, 2.0.11
    • 1.8.16, 2.0.12, 3.0.0 PDFBox
    • PDModel
    • None

    Description

      I've come across some pages in a large PDF that have some additional, non-numerical elements at the end of the MediaBox rectangle array, e.g. 

      /MediaBox [0 0 612 792 5 0 R 6 0 R]
      

      Trying to read such a structure with PDPage.getMediaBox() throws an exception trying to construct the PDRectangle at this line

      I'm not sure if this strange case should be treated as a file issue, or if should be supported by slicing / shortening the COSArray prior to trying to convert to floats. Acrobat Reader shows the pages without complaint.

      The original PDF was produced by Foxit PhantomPDF Printer Version 7.3.9.0803.

      Attachments

        1. weird-rectangle.pdf
          16 kB
          Ross Johnson

        Activity

          People

            tilman Tilman Hausherr
            rossj Ross Johnson
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: