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

Function test_add_ink_annot

tests/test_general.py:195–213  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

193 assert repr(f) == "Font('Noto Serif Regular')"
194
195def test_add_ink_annot():
196 import math
197 document = pymupdf.Document()
198 page = document.new_page()
199 line1 = []
200 line2 = []
201 for a in range( 0, 360*2, 15):
202 x = a
203 c = 300 + 200 * math.cos( a * math.pi/180)
204 s = 300 + 100 * math.sin( a * math.pi/180)
205 line1.append( (x, c))
206 line2.append( (x, s))
207 page.add_ink_annot( [line1, line2])
208 page.insert_text((100, 72), 'Hello world')
209 page.add_text_annot((200,200), "Some Text")
210 page.get_bboxlog()
211 path = f'{scriptdir}/resources/test_add_ink_annot.pdf'
212 document.save( path)
213 print( f'Have saved to: path={path!r}')
214
215def test_techwriter_append():
216 print(pymupdf.__doc__)

Callers

nothing calls this directly

Calls 7

new_pageMethod · 0.95
saveMethod · 0.95
add_ink_annotMethod · 0.80
add_text_annotMethod · 0.80
get_bboxlogMethod · 0.80
appendMethod · 0.45
insert_textMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…