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

Function test_add_widget

tests/test_widgets.py:243–253  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

241
242
243def test_add_widget():
244 doc = pymupdf.open()
245 page = doc.new_page()
246 w = pymupdf.Widget()
247 w.field_type = pymupdf.PDF_WIDGET_TYPE_BUTTON
248 w.rect = pymupdf.Rect(5, 5, 20, 20)
249 w.field_flags = pymupdf.PDF_BTN_FIELD_IS_PUSHBUTTON
250 w.field_name = "button"
251 w.fill_color = (0, 0, 1)
252 w.script = "app.alert('Hello, PDF!');"
253 page.add_widget(w)
254
255
256def test_interfield_calculation():

Callers

nothing calls this directly

Calls 2

new_pageMethod · 0.80
add_widgetMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…