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

Method load_annot

src/__init__.py:12713–12734  ·  view source on GitHub ↗

Load an annot by name (/NM key) or xref. Args: ident: identifier, either name (str) or xref (int).

(self, ident: typing.Union[str, int])

Source from the content-addressed store, hash-verified

12711 yield (link)
12712
12713 def load_annot(self, ident: typing.Union[str, int]) -> Annot:
12714 """Load an annot by name (/NM key) or xref.
12715
12716 Args:
12717 ident: identifier, either name (str) or xref (int).
12718 """
12719 CheckParent(self)
12720 if type(ident) is str:
12721 xref = 0
12722 name = ident
12723 elif type(ident) is int:
12724 xref = ident
12725 name = None
12726 else:
12727 raise ValueError("identifier must be a string or integer")
12728 val = self._load_annot(name, xref)
12729 if not val:
12730 return val
12731 val.thisown = True
12732 val.parent = weakref.proxy(self)
12733 self._annot_refs[id(val)] = val
12734 return val
12735
12736 def load_links(self):
12737 """Get first Link."""

Callers 2

annotsMethod · 0.95
test_stampFunction · 0.80

Calls 2

_load_annotMethod · 0.95
CheckParentFunction · 0.85

Tested by 1

test_stampFunction · 0.64