-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
KeyError: '/Root' due to invalid start of xref #1756
Comments
This command fixes it:
|
Thanks. Is it a reasonable ask that a better message be given if the trailer is missing? I'm guessing that actually repairing the PDF as ghostscript does is beyond the scope of what you want pypdf to do... |
The problem is not this specific case. Sure, we can (and regularly do) add robustness improvements. It's just a never ending story. There is an infinite number of ways the standard can be broken |
I was hoping that we could use similar techniques as web browsers / beautiful soup does for HTML for that problem. I just didn't have the time to look into it so far. |
@owurman |
The robustness improvement was just added to |
@owurman If you want I can add you as a contributor to https://pypdf.readthedocs.io/en/latest/meta/CONTRIBUTORS.html |
I was trying to get the pages for the attached PDF but received a KeyError: '/Root'. The file appears to be encrypted to me, but pdf.is_encrypted is False.
Environment
Which environment were you using when you encountered the problem?
$ python -m platform macOS-10.16-x86_64-i386-64bit $ python -c "import pypdf;print(pypdf.__version__)" 3.7.0
Code + PDF
It's a public document so it should be fine to add to your tests.
Traceback
The text was updated successfully, but these errors were encountered: