Skip to content

RuntimeError: xref 732 is not an annot of this page #2066

Answered by JorjMcKie
Abh4git asked this question in Q&A
Discussion options

You must be logged in to vote
  1. Line page = doc.load_page makes no sense at all and can be deleted
  2. If you iterate like this for annot in page.annots(): you will select every item in the page's annotations array - not only the highlight annotations which you actually want. Therefore, on page 3 (page.number = 2) you are running into that page page's array item 732 0 R which is no existing PDF object in this document. Clearly an invalid specification.

BTW not every error inside a PDF makes it totally unusable. This specific error for example, does not prevent most things, neither for PDF readers nor (Py-) MuPDF. But iterating over annotations occurs under the assumption, that we in fact deal with annotations - and not …

Replies: 9 comments 15 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

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

Comment options

You must be logged in to vote
5 replies
@Abh4git
Comment options

@JorjMcKie
Comment options

@JorjMcKie
Comment options

@Abh4git
Comment options

@JorjMcKie
Comment options

Answer selected by JorjMcKie
Comment options

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

Comment options

You must be logged in to vote
8 replies
@pachhaipurna
Comment options

@JorjMcKie
Comment options

@pachhaipurna
Comment options

@JorjMcKie
Comment options

@pachhaipurna
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
3 participants
Converted from issue

This discussion was converted from issue #2063 on November 20, 2022 06:55.