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

Function test_textbox2

tests/test_textbox.py:44–61  ·  view source on GitHub ↗

Use basic text insertion.

()

Source from the content-addressed store, hash-verified

42
43
44def test_textbox2():
45 """Use basic text insertion."""
46 doc = pymupdf.open()
47 ocg = doc.add_ocg("ocg1")
48 page = doc.new_page()
49 rect = pymupdf.Rect(50, 50, 400, 400)
50 blue = pymupdf.utils.getColor("lightblue")
51 red = pymupdf.utils.getColorHSV("red")
52 page.insert_textbox(
53 rect,
54 text,
55 align=pymupdf.TEXT_ALIGN_LEFT,
56 fontsize=12,
57 color=blue,
58 oc=ocg,
59 )
60 # check text containment
61 assert page.get_text() == page.get_text(clip=rect)
62
63
64def test_textbox3():

Callers

nothing calls this directly

Calls 4

add_ocgMethod · 0.80
new_pageMethod · 0.80
insert_textboxMethod · 0.45
get_textMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…