[ 
https://issues.apache.org/jira/browse/PDFBOX-4227?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Tilman Hausherr resolved PDFBOX-4227.
-------------------------------------
       Resolution: Fixed
         Assignee: Tilman Hausherr
    Fix Version/s: 3.0.0 PDFBox
                   2.0.10

Please test with the snapshot here:
https://repository.apache.org/content/groups/snapshots/org/apache/pdfbox/pdfbox-app/2.0.10-SNAPSHOT/

> java.util.zip.DataFormatException: invalid distance too far back
> ----------------------------------------------------------------
>
>                 Key: PDFBOX-4227
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-4227
>             Project: PDFBox
>          Issue Type: Bug
>          Components: Utilities
>    Affects Versions: 2.0.9
>            Reporter: Michael Miller
>            Assignee: Tilman Hausherr
>            Priority: Major
>             Fix For: 2.0.10, 3.0.0 PDFBox
>
>         Attachments: testCorrupt.pdf
>
>
> 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



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@pdfbox.apache.org
For additional commands, e-mail: dev-h...@pdfbox.apache.org

Reply via email to