Skip to content

How to tackle such error : PdfReadWarning: Object 16920 0 not defined #1846

Discussion options

You must be logged in to vote

Your code is more or less already part of PyMuPDF's since the latest 1.19.x version. It is being checked (not only for PDF!), whether the file exists and has a length > 0.
For some file types (non-PDF) a few additional checks are also performed.

For PDFs, MuPDF performs additional checks at open time and automatically starts repair algorithms to, for example, ensure that a usable PDF trailer does exist. If determining that a trailer is missing (often happens b/o incomplete downloads), a complete scan of all xref objects will be made to rebuild the xref table.
But it never walks through all of the PDF's internal structure unnecessarily / without reasons to be suspicious! Which is good.
If …

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@arcontechnologies
Comment options

Answer selected by JorjMcKie
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants