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

java.lang.IndexOutOfBoundsException

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.8.16, 2.0.21
    • 1.8.17, 2.0.22, 3.0.0 PDFBox
    • Utilities
    • None
    • Debian 10

    Description

      Exception in thread "main" java.lang.IndexOutOfBoundsException: Index 205 out of bounds for length 205
              at java.base/jdk.internal.util.Preconditions.outOfBounds(Preconditions.java:64)
              at java.base/jdk.internal.util.Preconditions.outOfBoundsCheckIndex(Preconditions.java:70)
              at java.base/jdk.internal.util.Preconditions.checkIndex(Preconditions.java:248)
              at java.base/java.util.Objects.checkIndex(Objects.java:372)
              at java.base/java.util.ArrayList.get(ArrayList.java:459)
              at org.apache.pdfbox.cos.COSArray.getObject(COSArray.java:188)
              at org.apache.pdfbox.pdmodel.common.PDNumberTreeNode.getNumbers(PDNumberTreeNode.java:192)
              at org.apache.pdfbox.multipdf.PDFMergerUtility.getNumberTreeAsMap(PDFMergerUtility.java:1062)
              at org.apache.pdfbox.multipdf.PDFMergerUtility.getNumberTreeAsMap(PDFMergerUtility.java:1077)
              at org.apache.pdfbox.multipdf.PDFMergerUtility.appendDocument(PDFMergerUtility.java:782)
              at org.apache.pdfbox.multipdf.PDFMergerUtility.legacyMergeDocuments(PDFMergerUtility.java:459)
              at org.apache.pdfbox.multipdf.PDFMergerUtility.mergeDocuments(PDFMergerUtility.java:346)
              at org.apache.pdfbox.tools.PDFMerger.merge(PDFMerger.java:70)
              at org.apache.pdfbox.tools.PDFMerger.main(PDFMerger.java:49)
              at org.apache.pdfbox.tools.PDFBox.main(PDFBox.java:81)
      
      

      Can't share the files publicly, but if someone is willing to look at them, I can send them via e-mail or dropbox. The command is:

       

      java -jar pdfbox-app-2.0.21.jar PDFMerger first.pdf second.pdf output.pdf
      

      Attachments

        Issue Links

          Activity

            People

              tilman Tilman Hausherr
              jmvezic Jakov Vežić
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: