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

Method load_links

src/__init__.py:12736–12758  ·  view source on GitHub ↗

Get first Link.

(self)

Source from the content-addressed store, hash-verified

12734 return val
12735
12736 def load_links(self):
12737 """Get first Link."""
12738 CheckParent(self)
12739 val = mupdf.fz_load_links( self.this)
12740 if not val.m_internal:
12741 return
12742 val = Link( val)
12743 val.thisown = True
12744 val.parent = weakref.proxy(self) # owning page object
12745 self._annot_refs[id(val)] = val
12746 val.xref = 0
12747 val.id = ""
12748 if self.parent.is_pdf:
12749 xrefs = self.annot_xrefs()
12750 xrefs = [x for x in xrefs if x[1] == mupdf.PDF_ANNOT_LINK]
12751 if xrefs:
12752 link_id = xrefs[0]
12753 val.xref = link_id[0]
12754 val.id = link_id[2]
12755 else:
12756 val.xref = 0
12757 val.id = ""
12758 return val
12759
12760 #----------------------------------------------------------------
12761 # page load widget by xref

Callers 1

first_linkMethod · 0.95

Calls 3

annot_xrefsMethod · 0.95
CheckParentFunction · 0.85
LinkClass · 0.85

Tested by

no test coverage detected