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

IndexOutOfBoundsException on CMapParser

    XMLWordPrintableJSON

Details

    Description

      I got the next stacktrace in PDF->HTML conversion using Tika:

      java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
      	at java.util.ArrayList.rangeCheck(ArrayList.java:635)
      	at java.util.ArrayList.get(ArrayList.java:411)
      	at org.apache.fontbox.cmap.CMapParser.parseBeginbfrange(CMapParser.java:364)
      	at org.apache.fontbox.cmap.CMapParser.parse(CMapParser.java:136)
      	at org.apache.pdfbox.pdmodel.font.CMapManager.parseCMap(CMapManager.java:73)
      	at org.apache.pdfbox.pdmodel.font.PDFont.readCMap(PDFont.java:197)
      	at org.apache.pdfbox.pdmodel.font.PDFont.<init>(PDFont.java:137)
      	at org.apache.pdfbox.pdmodel.font.PDType0Font.<init>(PDType0Font.java:119)
      	at org.apache.pdfbox.pdmodel.font.PDFontFactory.createFont(PDFontFactory.java:83)
      	at org.apache.pdfbox.pdmodel.PDResources.getFont(PDResources.java:143)
      	at org.apache.pdfbox.contentstream.operator.text.SetFontAndSize.process(SetFontAndSize.java:60)
      	at org.apache.pdfbox.contentstream.PDFStreamEngine.processOperator(PDFStreamEngine.java:838)
      	at org.apache.pdfbox.contentstream.PDFStreamEngine.processStreamOperators(PDFStreamEngine.java:495)
      	at org.apache.pdfbox.contentstream.PDFStreamEngine.processStream(PDFStreamEngine.java:469)
      	at org.apache.pdfbox.contentstream.PDFStreamEngine.processPage(PDFStreamEngine.java:150)
      	at org.apache.pdfbox.text.LegacyPDFStreamEngine.processPage(LegacyPDFStreamEngine.java:139)
      	at org.apache.pdfbox.text.PDFTextStripper.processPage(PDFTextStripper.java:391)
      	at org.apache.tika.parser.pdf.PDF2XHTML.processPage(PDF2XHTML.java:147)
      	at org.apache.pdfbox.text.PDFTextStripper.processPages(PDFTextStripper.java:319)
      	at org.apache.pdfbox.text.PDFTextStripper.writeText(PDFTextStripper.java:266)
      	at org.apache.tika.parser.pdf.PDF2XHTML.process(PDF2XHTML.java:117)
      	at org.apache.tika.parser.pdf.PDFParser.parse(PDFParser.java:159)
      	at org.apache.tika.parser.CompositeParser.parse(CompositeParser.java:280)
      

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: