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

StackOverflowError with PDFTextStripper.getText()

    XMLWordPrintableJSON

Details

    Description

      Reproducible with the attached file

       

      File pdf = new File("example.pdf");
      PDDocument doc = PDDocument.load(pdf);
      new PDFTextStripper().getText(doc);
      

       

      java.lang.StackOverflowErrorjava.lang.StackOverflowError at java.util.zip.Inflater.<init>(Inflater.java:102) at org.apache.pdfbox.filter.FlateFilter.decompress(FlateFilter.java:74) at org.apache.pdfbox.filter.FlateFilter.decode(FlateFilter.java:50) at org.apache.pdfbox.filter.Filter.decode(Filter.java:87) at org.apache.pdfbox.cos.COSInputStream.create(COSInputStream.java:84) at org.apache.pdfbox.cos.COSStream.createInputStream(COSStream.java:175) at org.apache.pdfbox.cos.COSStream.createInputStream(COSStream.java:163) at org.apache.pdfbox.pdmodel.graphics.form.PDFormXObject.getContents(PDFormXObject.java:144) at org.apache.pdfbox.pdfparser.PDFStreamParser.<init>(PDFStreamParser.java:92) at org.apache.pdfbox.contentstream.PDFStreamEngine.processStreamOperators(PDFStreamEngine.java:496) at org.apache.pdfbox.contentstream.PDFStreamEngine.processStream(PDFStreamEngine.java:480) at org.apache.pdfbox.contentstream.PDFStreamEngine.showForm(PDFStreamEngine.java:184) at org.apache.pdfbox.contentstream.operator.DrawObject.process(DrawObject.java:65) at org.apache.pdfbox.contentstream.PDFStreamEngine.processOperator(PDFStreamEngine.java:872) at org.apache.pdfbox.contentstream.PDFStreamEngine.processStreamOperators(PDFStreamEngine.java:506) at org.apache.pdfbox.contentstream.PDFStreamEngine.processStream(PDFStreamEngine.java:480) at org.apache.pdfbox.contentstream.PDFStreamEngine.showForm(PDFStreamEngine.java:184) at org.apache.pdfbox.contentstream.operator.DrawObject.process(DrawObject.java:65) at org.apache.pdfbox.contentstream.PDFStreamEngine.processOperator(PDFStreamEngine.java:872) at org.apache.pdfbox.contentstream.PDFStreamEngine.processStreamOperators(PDFStreamEngine.java:506) at org.apache.pdfbox.contentstream.PDFStreamEngine.processStream(PDFStreamEngine.java:480) at org.apache.pdfbox.contentstream.PDFStreamEngine.showForm(PDFStreamEngine.java:184) at org.apache.pdfbox.contentstream.operator.DrawObject.process(DrawObject.java:65) at org.apache.pdfbox.contentstream.PDFStreamEngine.processOperator(PDFStreamEngine.java:872) at org.apache.pdfbox.contentstream.PDFStreamEngine.processStreamOperators(PDFStreamEngine.java:506) at org.apache.pdfbox.contentstream.PDFStreamEngine.processStream(PDFStreamEngine.java:480) at org.apache.pdfbox.contentstream.PDFStreamEngine.showForm(PDFStreamEngine.java:184) at org.apache.pdfbox.contentstream.operator.DrawObject.process(DrawObject.java:65) at org.apache.pdfbox.contentstream.PDFStreamEngine.processOperator(PDFStreamEngine.java:872) at org.apache.pdfbox.contentstream.PDFStreamEngine.processStreamOperators(PDFStreamEngine.java:506) at org.apache.pdfbox.contentstream.PDFStreamEngine.processStream(PDFStreamEngine.java:480) at org.apache.pdfbox.contentstream.PDFStreamEngine.showForm(PDFStreamEngine.java:184) at org.apache.pdfbox.contentstream.operator.DrawObject.process(DrawObject.java:65) at org.apache.pdfbox.contentstream.PDFStreamEngine.processOperator(PDFStreamEngine.java:872) at org.apache.pdfbox.contentstream.PDFStreamEngine.processStreamOperators(PDFStreamEngine.java:506) at org.apache.pdfbox.contentstream.PDFStreamEngine.processStream(PDFStreamEngine.java:480) at org.apache.pdfbox.contentstream.PDFStreamEngine.showForm(PDFStreamEngine.java:184) at org.apache.pdfbox.contentstream.operator.DrawObject.process(DrawObject.java:65) at org.apache.pdfbox.contentstream.PDFStreamEngine.processOperator(PDFStreamEngine.java:872) at org.apache.pdfbox.contentstream.PDFStreamEngine.processStreamOperators(PDFStreamEngine.java:506) at org.apache.pdfbox.contentstream.PDFStreamEngine.processStream(PDFStreamEngine.java:480) at org.apache.pdfbox.contentstream.PDFStreamEngine.showForm(PDFStreamEngine.java:184)
      ...
       at org.apache.pdfbox.contentstream.operator.DrawObject.process(DrawObject.java:65) at org.apache.pdfbox.contentstream.PDFStreamEngine.processOperator(PDFStreamEngine.java:872) at org.apache.pdfbox.contentstream.PDFStreamEngine.processStreamOperators(PDFStreamEngine.java:506) at org.apache.pdfbox.contentstream.PDFStreamEngine.processStream(PDFStreamEngine.java:480) at org.apache.pdfbox.contentstream.PDFStreamEngine.processPage(PDFStreamEngine.java:153)
       at org.apache.pdfbox.text.LegacyPDFStreamEngine.processPage(LegacyPDFStreamEngine.java:139) at org.apache.pdfbox.text.PDFTextStripper.processPage(PDFTextStripper.java:391) at org.apache.pdfbox.text.PDFTextStripper.processPages(PDFTextStripper.java:319) at org.apache.pdfbox.text.PDFTextStripper.writeText(PDFTextStripper.java:266) at org.apache.pdfbox.text.PDFTextStripper.getText(PDFTextStripper.java:227)

      Attachments

        1. example.pdf
          299 kB
          Josh Wein

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved: