Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
2.0.9
-
None
Description
I get a zip exception with the attached PDF file, which renders successfully in a couple of PDF viewers I tried.
ByteArrayInputStream pdfInputStream = new ByteArrayInputStream(pdfByteArray);
PDFMergerUtility merger = new PDFMergerUtility();
merger.addSource(pdfInputStream);
ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
merger.setDestinationStream(outputStream);
merger.mergeDocuments(MemoryUsageSetting.setupMainMemoryOnly());
PDF file attached.
Stack Trace:
java.io.IOException: java.util.zip.DataFormatException: invalid distance too far back
at org.apache.pdfbox.filter.FlateFilter.decode(FlateFilter.java:83)
at org.apache.pdfbox.filter.Filter.decode(Filter.java:87)
at org.apache.pdfbox.cos.COSInputStream.create(COSInputStream.java:77)
at org.apache.pdfbox.cos.COSStream.createInputStream(COSStream.java:175)
at org.apache.pdfbox.cos.COSStream.createInputStream(COSStream.java:163)
at org.apache.pdfbox.multipdf.PDFMergerUtility.appendDocument(PDFMergerUtility.java:516)
at org.apache.pdfbox.multipdf.PDFMergerUtility.mergeDocuments(PDFMergerUtility.java:263)
...
Caused by: java.util.zip.DataFormatException: invalid distance too far back
at java.util.zip.Inflater.inflateBytes(Native Method)
at java.util.zip.Inflater.inflate(Inflater.java:259)
at java.util.zip.Inflater.inflate(Inflater.java:280)
at org.apache.pdfbox.filter.FlateFilter.decompress(FlateFilter.java:108)
at org.apache.pdfbox.filter.FlateFilter.decode(FlateFilter.java:74)
... 35 more