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

Method load_widget

src/__init__.py:12763–12779  ·  view source on GitHub ↗

Load a widget by its xref.

( self, xref)

Source from the content-addressed store, hash-verified

12761 # page load widget by xref
12762 #----------------------------------------------------------------
12763 def load_widget( self, xref):
12764 """Load a widget by its xref."""
12765 CheckParent(self)
12766
12767 page = _as_pdf_page(self.this)
12768 annot = JM_get_widget_by_xref( page, xref)
12769 #log( '{=type(annot)}')
12770 val = annot
12771 if not val:
12772 return val
12773 val.thisown = True
12774 val.parent = weakref.proxy(self)
12775 self._annot_refs[id(val)] = val
12776 widget = Widget()
12777 TOOLS._fill_widget(val, widget)
12778 val = widget
12779 return val
12780
12781 @property
12782 def mediabox(self):

Callers 3

widgetsMethod · 0.95
test_2333Function · 0.80
test_4505Function · 0.80

Calls 5

CheckParentFunction · 0.85
_as_pdf_pageFunction · 0.85
JM_get_widget_by_xrefFunction · 0.85
WidgetClass · 0.85
_fill_widgetMethod · 0.80

Tested by 2

test_2333Function · 0.64
test_4505Function · 0.64