Skip to content

Working with the annotation of the PDF file using Page.first_annot #1841

Discussion options

You must be logged in to vote

Annotations of a PDF page are stored within its object definition as an array of xref numbers that looks like so: /Annots [ 5 0 R 9 0 R]. Here you can deduct, that annot with xref 9 was created after annot with xref 5 had been created.
New annotations are appended to this array. So the sequence is no indication for the items' positions on the page.

Also note that this array contains every object that PDF counts as an annotation type: links, fields, other annotations. In (Py-) MuPDF, these categories appear as logically different subtypes and are yielded under different Python iterators.

The page properties first_link, first_annot, first_widget and the associated iterators walk through t…

Replies: 1 comment 1 reply

Comment options

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

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