MCPcopy Create free account
hub / github.com/pymupdf/PyMuPDF / annots

Method annots

src/__init__.py:10641–10657  ·  view source on GitHub ↗

Generator over the annotations of a page. Args: types: (list) annotation types to subselect from. If none, all annotations are returned. E.g. types=[PDF_ANNOT_LINE] will only yield line annotations.

(self, types=None)

Source from the content-addressed store, hash-verified

10639 return JM_get_annot_xref_list2(self)
10640
10641 def annots(self, types=None):
10642 """ Generator over the annotations of a page.
10643
10644 Args:
10645 types: (list) annotation types to subselect from. If none,
10646 all annotations are returned. E.g. types=[PDF_ANNOT_LINE]
10647 will only yield line annotations.
10648 """
10649 skip_types = (mupdf.PDF_ANNOT_LINK, mupdf.PDF_ANNOT_POPUP, mupdf.PDF_ANNOT_WIDGET)
10650 if not hasattr(types, "__getitem__"):
10651 annot_xrefs = [a[0] for a in self.annot_xrefs() if a[1] not in skip_types]
10652 else:
10653 annot_xrefs = [a[0] for a in self.annot_xrefs() if a[1] in types and a[1] not in skip_types]
10654 for xref in annot_xrefs:
10655 annot = self.load_annot(xref)
10656 annot._yielded=True
10657 yield annot
10658
10659 def apply_redactions(
10660 page: 'Page',

Callers 14

remove_rotationMethod · 0.95
scrubMethod · 0.80
apply_redactionsMethod · 0.80
apply_redactionsFunction · 0.80
scrubFunction · 0.80
test_polylineFunction · 0.80
test_lineFunction · 0.80
test_2270Function · 0.80
test_2969Function · 0.80
test_file_infoFunction · 0.80
test_3131Function · 0.80
test_3209Function · 0.80

Calls 2

annot_xrefsMethod · 0.95
load_annotMethod · 0.95

Tested by 9

test_polylineFunction · 0.64
test_lineFunction · 0.64
test_2270Function · 0.64
test_2969Function · 0.64
test_file_infoFunction · 0.64
test_3131Function · 0.64
test_3209Function · 0.64
test_4254Function · 0.64
test_2182Function · 0.64