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

IllegalArgumentException: Parameter must be 1-based, but is 0 when using PDFTextStripperByArea

    XMLWordPrintableJSON

Details

    Description

      As reported by Pascal Schumacher in the users mailing list
      https://lists.apache.org/thread/yb42j9s5vp8jsjog9msplbc05y1xqwv3

      java.lang.IllegalArgumentException: Parameter must be 1-based, but is 0
      at org.apache.pdfbox.text.PDFTextStripper.setStartPage(PDFTextStripper.java:956)
      at org.apache.pdfbox.text.PDFTextStripperByArea.extractRegions(PDFTextStripperByArea.java:117)

      this is because of this earlier seemingly "harmless" commit
      https://github.com/apache/pdfbox/commit/5c0abf94367c12c9ac0b464046784d456ce4caf5

      that broke PDFTextStripperByArea because it has two calls with 0 parameter.

      This wasn't discovered because we have no tests for PDFTextStripperByArea 😬

      Attachments

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved: