Use basic text insertion.
()
| 42 | |
| 43 | |
| 44 | def 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 | |
| 64 | def test_textbox3(): |
nothing calls this directly
no test coverage detected
searching dependent graphs…