Handling of root objects without a Type #3164
Labels
is-robustness-issue
From a users perspective, this is about robustness
PdfReader
The PdfReader component is affected
I am currently trying to handle some partially broken PDF files which have root objects not carrying a
/Type
, thus failingpypdf/pypdf/_reader.py
Lines 210 to 211 in b7f3811
pypdf/pypdf/_reader.py
Line 226 in b7f3811
pypdf/pypdf/_reader.py
Line 230 in b7f3811
self._validated_root = root.get_object()
as a fallback seems to work in this case, but probably has other side effects.Environment
Which environment were you using when you encountered the problem?
Code + PDF
This is a minimal, complete example that shows the issue:
This should be easy enough to reproduce by tampering with a valid PDF file, while the original file contains confidential information. The relevant root object:
Traceback
This is the complete traceback I see (line numbers might be off):
The text was updated successfully, but these errors were encountered: