From 94710bc75db4f1c3b8a7b9fcd9f83454295b3bd9 Mon Sep 17 00:00:00 2001 From: TVC-ScS <94958386+TVC-ScS@users.noreply.github.com> Date: Wed, 24 Nov 2021 09:39:46 +0100 Subject: [PATCH] Update filters.py according to pypdf2 (issue #422) There are some errors in some cases during zlib decompression (eg. I have a PDF with overlay of text, it is the same issue which is documented here https://github.com/mstamy2/PyPDF2/issues/422 ). With this change, the decompression is working without errors. --- pypdf/filters.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pypdf/filters.py b/pypdf/filters.py index 5cedd6625..caac93ddf 100644 --- a/pypdf/filters.py +++ b/pypdf/filters.py @@ -43,7 +43,7 @@ import zlib def decompress(data): - return zlib.decompress(data) + return zlib.decompressobj().decompress(data) def compress(data): return zlib.compress(data)