lopdf icon indicating copy to clipboard operation
lopdf copied to clipboard

Hopefully the last panic

Open manfredlotz opened this issue 6 years ago • 5 comments

This document https://www.uspsoig.gov/sites/default/files/document-library-files/2016/RARC-WP-16-001.pdf

gives:

thread 'main' panicked at 'called Result::unwrap() on an Err value: Custom { kind: InvalidInput, error: StringError("corrupt deflate stream") }', libcore/result.rs:945:5

manfredlotz avatar Oct 10 '18 11:10 manfredlotz

The data of 5093 0 object is actually not a valid zlib stream, so can not be decompressed.

J-F-Liu avatar Oct 17 '18 15:10 J-F-Liu

I understand. However, as PDF viewers are happy when loading the document what should be the solution.

Perhaps lopdf should have a 'relaxed' option where such oddities are handled gracefully (i.e no panic, only a warning or so). Not sure.

manfredlotz avatar Oct 17 '18 17:10 manfredlotz

This file is encrypted, so decryption is needed before decompress.

J-F-Liu avatar Oct 24 '18 04:10 J-F-Liu

Do you plan to implement it?

manfredlotz avatar Oct 25 '18 03:10 manfredlotz

Yes, but not high priority, maybe in 2019.

J-F-Liu avatar Oct 25 '18 05:10 J-F-Liu