sfneal / PyPDF3

A utility to read and write PDFs with Python
https://pythonhosted.org/PyPDF2/
Other
72 stars 15 forks source link

Use zlib.decompressobj() do decode streams #20

Open krsarmiento opened 2 years ago

krsarmiento commented 2 years ago

Hi guys! We have a fix for PyPDF2 for the zlib.error: Error -5 while decompressing data: incomplete or truncated stream.

https://github.com/py-pdf/PyPDF2/pull/609

I want to include this fix here so I added a created a branch but I don't have right access to push it. Basically I added this PDF:

form_acrobatReader.pdf

Which raises the error.

return zlib.decompress(data) zlib.error: Error -5 while decompressing data: incomplete or truncated stream

So I added this file to the Resources/ folder and a simple unit test to make sure it works.

Screen Shot 2022-09-06 at 9 32 07 PM

The change is just a simple line:

return zlib.decompressobj().decompress(data)

How can I get access?