MCPcopy Index your code
hub / github.com/pymupdf/PyMuPDF / widgets

Method widgets

src/__init__.py:13146–13161  ·  view source on GitHub ↗

Generator over the widgets of a page. Args: types: (list) field types to subselect from. If none, all fields are returned. E.g. types=[PDF_WIDGET_TYPE_TEXT] will only yield text fields.

(self, types=None)

Source from the content-addressed store, hash-verified

13144 page.parent.update_object(lnk["xref"], annot, page=page)
13145
13146 def widgets(self, types=None):
13147 """ Generator over the widgets of a page.
13148
13149 Args:
13150 types: (list) field types to subselect from. If none,
13151 all fields are returned. E.g. types=[PDF_WIDGET_TYPE_TEXT]
13152 will only yield text fields.
13153 """
13154 #for a in self.annot_xrefs():
13155 # log( '{a=}')
13156 widget_xrefs = [a[0] for a in self.annot_xrefs() if a[1] == mupdf.PDF_ANNOT_WIDGET]
13157 #log(f'widgets(): {widget_xrefs=}')
13158 for xref in widget_xrefs:
13159 widget = self.load_widget(xref)
13160 if types is None or widget.field_type in types:
13161 yield (widget)
13162
13163 def wrap_contents(self):
13164 """Ensure page is in a balanced graphics state."""

Callers 11

remove_rotationMethod · 0.95
scrubMethod · 0.80
scrubFunction · 0.80
test_text2Function · 0.80
test_2391Function · 0.80
test_3950Function · 0.80
get_widgets_by_nameFunction · 0.80
test_4055Function · 0.80
test_4505Function · 0.80
analysisFunction · 0.80

Calls 2

annot_xrefsMethod · 0.95
load_widgetMethod · 0.95

Tested by 8

test_text2Function · 0.64
test_2391Function · 0.64
test_3950Function · 0.64
get_widgets_by_nameFunction · 0.64
test_4055Function · 0.64
test_4505Function · 0.64
analysisFunction · 0.64