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

DataFormatException: invalid code lengths set when rendering image

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.0.7, 2.0.8, 2.0.9
    • 2.0.10, 3.0.0 PDFBox
    • Rendering
    • None

    Description

      When rendering image from the attached pdf, an exception was thrown and below is the relevant stack trace:

      java.util.zip.DataFormatException: invalid code lengths set
          at java.util.zip.Inflater.inflateBytes(Native Method) ~[?:1.8.0_121]
          at java.util.zip.Inflater.inflate(Inflater.java:259) ~[?:1.8.0_121]
          at java.util.zip.Inflater.inflate(Inflater.java:280) ~[?:1.8.0_121]
          at org.apache.pdfbox.filter.FlateFilter.decompress(FlateFilter.java:108) ~[pdfbox-2.0.9.jar:2.0.9]
          at org.apache.pdfbox.filter.FlateFilter.decode(FlateFilter.java:74) ~[pdfbox-2.0.9.jar:2.0.9]
          at org.apache.pdfbox.filter.Filter.decode(Filter.java:87) ~[pdfbox-2.0.9.jar:2.0.9]
          at org.apache.pdfbox.cos.COSInputStream.create(COSInputStream.java:77) ~[pdfbox-2.0.9.jar:2.0.9]
          at org.apache.pdfbox.cos.COSStream.createInputStream(COSStream.java:175) ~[pdfbox-2.0.9.jar:2.0.9]
          at org.apache.pdfbox.cos.COSStream.createInputStream(COSStream.java:163) ~[pdfbox-2.0.9.jar:2.0.9]
          at org.apache.pdfbox.pdmodel.common.PDStream.createInputStream(PDStream.java:236) ~[pdfbox-2.0.9.jar:2.0.9]
          at org.apache.pdfbox.pdmodel.graphics.color.PDICCBased.loadICCProfile(PDICCBased.java:124) ~[pdfbox-2.0.9.jar:2.0.9]
          at org.apache.pdfbox.pdmodel.graphics.color.PDICCBased.<init>(PDICCBased.java:98) ~[pdfbox-2.0.9.jar:2.0.9]
          at org.apache.pdfbox.pdmodel.graphics.color.PDColorSpace.create(PDColorSpace.java:192) ~[pdfbox-2.0.9.jar:2.0.9]
          at org.apache.pdfbox.pdmodel.PDResources.getColorSpace(PDResources.java:199) ~[pdfbox-2.0.9.jar:2.0.9]
          at org.apache.pdfbox.pdmodel.PDResources.getColorSpace(PDResources.java:169) ~[pdfbox-2.0.9.jar:2.0.9]
          at org.apache.pdfbox.contentstream.operator.color.SetNonStrokingColorSpace.process(SetNonStrokingColorSpace.java:41) ~[pdfbox-2.0.9.jar:2.0.9]
          at org.apache.pdfbox.contentstream.PDFStreamEngine.processOperator(PDFStreamEngine.java:848) ~[pdfbox-2.0.9.jar:2.0.9]
          at org.apache.pdfbox.contentstream.PDFStreamEngine.processStreamOperators(PDFStreamEngine.java:503) ~[pdfbox-2.0.9.jar:2.0.9]
          at org.apache.pdfbox.contentstream.PDFStreamEngine.processStream(PDFStreamEngine.java:477) ~[pdfbox-2.0.9.jar:2.0.9]
          at org.apache.pdfbox.contentstream.PDFStreamEngine.processPage(PDFStreamEngine.java:150) ~[pdfbox-2.0.9.jar:2.0.9]
          at org.apache.pdfbox.rendering.PageDrawer.drawPage(PageDrawer.java:246) ~[pdfbox-2.0.9.jar:2.0.9]
          at org.apache.pdfbox.rendering.PDFRenderer.renderImage(PDFRenderer.java:225) ~[pdfbox-2.0.9.jar:2.0.9]
          at org.apache.pdfbox.rendering.PDFRenderer.renderImage(PDFRenderer.java:138) ~[pdfbox-2.0.9.jar:2.0.9]

      Attachments

        1. invalid.pdf
          110 kB
          Xin Lin
        2. BSD SOP No Instructions.pdf
          460 kB
          Xin Lin

        Activity

          People

            tilman Tilman Hausherr
            xin.lin Xin Lin
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: