maxpmaxp / pdfreader

Python API for PDF documents
MIT License
113 stars 26 forks source link

Zlib error #88

Closed joshlsullivan closed 2 years ago

joshlsullivan commented 2 years ago

When I'm processing a PDF, I'm getting this error:

ERROR:root:Skipping broken stream Traceback (most recent call last): File "/Users/joshsullivan/.local/share/virtualenvs/Main-Website-6cvVj0D7/lib/python3.9/site-packages/pdfreader/filters/ascii85.py", line 26, in decode res = b85decode(data[:-2]) File "/opt/homebrew/Cellar/python@3.9/3.9.10/Frameworks/Python.framework/Versions/3.9/lib/python3.9/base64.py", line 463, in b85decode raise ValueError('bad base85 character at position %d' ValueError: bad base85 character at position 2 ERROR:root:Skipping broken stream Traceback (most recent call last): File "/Users/joshsullivan/.local/share/virtualenvs/Main-Website-6cvVj0D7/lib/python3.9/site-packages/pdfreader/filters/flate.py", line 20, in decode data = zlib.decompress(data) zlib.error: Error -5 while decompressing data: incomplete or truncated stream

maxpmaxp commented 2 years ago

Can you attache the PDF please?

maxpmaxp commented 2 years ago

@joshlsullivan the most likely the object stream is broken. Need to see the doc.

maxpmaxp commented 2 years ago

@joshlsullivan should be fixed in v 0.1.11