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

index out of bounds exception

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 0.8.0-incubator
    • 0.8.0-incubator
    • None
    • None

    Description

      this is with svn revision 773978

      I get this error with several pdf files,

      Caused by: java.lang.StringIndexOutOfBoundsException: String index out of range: 0
      at java.lang.String.charAt(String.java:687)
      at org.apache.pdfbox.pdfparser.PDFParser.parseHeader(PDFParser.java:281)
      at org.apache.pdfbox.pdfparser.PDFParser.parse(PDFParser.java:156)
      ... 3 more

      I can't give you the pdf file, but changing PDFParser line 281 to,

      if (header.length() > 0 && Character.isDigit (header.charAt(0)))

      fixes it.

      Attachments

        Activity

          People

            Unassigned Unassigned
            sgbridges Sean Bridges
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: