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

Method first_widget

src/__init__.py:11410–11427  ·  view source on GitHub ↗

First widget/field.

(self)

Source from the content-addressed store, hash-verified

11408
11409 @property
11410 def first_widget(self):
11411 """First widget/field."""
11412 CheckParent(self)
11413 annot = 0
11414 page = self._pdf_page(required=False)
11415 if not page.m_internal:
11416 return
11417 annot = mupdf.pdf_first_widget(page)
11418 if not annot.m_internal:
11419 return
11420 val = Annot(annot)
11421 val.thisown = True
11422 val.parent = weakref.proxy(self) # owning page object
11423 self._annot_refs[id(val)] = val
11424 widget = Widget()
11425 TOOLS._fill_widget(val, widget)
11426 val = widget
11427 return val
11428
11429 def get_bboxlog(self, layers=None):
11430 CheckParent(self)

Callers

nothing calls this directly

Calls 5

_pdf_pageMethod · 0.95
CheckParentFunction · 0.85
AnnotClass · 0.85
WidgetClass · 0.85
_fill_widgetMethod · 0.80

Tested by

no test coverage detected