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

Function test_text2

tests/test_widgets.py:141–159  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

139
140
141def test_text2():
142 doc = pymupdf.open()
143 doc.new_page()
144 page = [p for p in doc.pages()][0]
145 widget = pymupdf.Widget()
146 widget.field_name = "textfield-2"
147 widget.field_label = "multi-line text with tabs is also possible!"
148 widget.field_flags = pymupdf.PDF_TX_FIELD_IS_MULTILINE
149 widget.field_type = pymupdf.PDF_WIDGET_TYPE_TEXT
150 widget.fill_color = gray
151 widget.rect = rect
152 widget.text_color = blue
153 widget.text_font = "TiRo"
154 widget.text_fontsize = fontsize
155 widget.field_value = "This\n\tis\n\t\ta\n\t\t\tmulti-\n\t\tline\n\ttext."
156 page.add_widget(widget) # create the field
157 widgets = [w for w in page.widgets()]
158 field = widgets[0]
159 assert field.field_type_string == "Text"
160
161
162def test_2333():

Callers

nothing calls this directly

Calls 4

new_pageMethod · 0.80
pagesMethod · 0.80
add_widgetMethod · 0.80
widgetsMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…