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

Function test_techwriter_append

tests/test_general.py:215–228  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

213 print( f'Have saved to: path={path!r}')
214
215def test_techwriter_append():
216 print(pymupdf.__doc__)
217 doc = pymupdf.open()
218 page = doc.new_page()
219 tw = pymupdf.TextWriter(page.rect)
220 text = "Red rectangle = TextWriter.text_rect, blue circle = .last_point"
221 r = tw.append((100, 100), text)
222 print(f'r={r!r}')
223 tw.write_text(page)
224 page.draw_rect(tw.text_rect, color=pymupdf.pdfcolor["red"])
225 page.draw_circle(tw.last_point, 2, color=pymupdf.pdfcolor["blue"])
226 path = f"{scriptdir}/resources/test_techwriter_append.pdf"
227 doc.ez_save(path)
228 print( f'Have saved to: {path}')
229
230def test_opacity():
231 doc = pymupdf.open()

Callers

nothing calls this directly

Calls 6

appendMethod · 0.95
write_textMethod · 0.95
new_pageMethod · 0.80
ez_saveMethod · 0.80
draw_rectMethod · 0.45
draw_circleMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…