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

Function JM_find_annot_irt

src/__init__.py:19379–19403  ·  view source on GitHub ↗

Return the first annotation whose /IRT key ("In Response To") points to annot. Used to remove the response chain of a given annotation.

(annot)

Source from the content-addressed store, hash-verified

19377
19378
19379def JM_find_annot_irt(annot):
19380 '''
19381 Return the first annotation whose /IRT key ("In Response To") points to
19382 annot. Used to remove the response chain of a given annotation.
19383 '''
19384 assert isinstance(annot, mupdf.PdfAnnot)
19385 irt_annot = None # returning this
19386 annot_obj = mupdf.pdf_annot_obj(annot)
19387 found = 0
19388 # loop thru MuPDF's internal annots array
19389 page = _pdf_annot_page(annot)
19390 irt_annot = mupdf.pdf_first_annot(page)
19391 while 1:
19392 assert isinstance(irt_annot, mupdf.PdfAnnot)
19393 if not irt_annot.m_internal:
19394 break
19395 irt_annot_obj = mupdf.pdf_annot_obj(irt_annot)
19396 o = mupdf.pdf_dict_gets(irt_annot_obj, 'IRT')
19397 if o.m_internal:
19398 if not mupdf.pdf_objcmp(o, annot_obj):
19399 found = 1
19400 break
19401 irt_annot = mupdf.pdf_next_annot(irt_annot)
19402 if found:
19403 return irt_annot
19404
19405
19406def JM_font_ascender(font):

Callers 2

delete_responsesMethod · 0.85
delete_annotMethod · 0.85

Calls 1

_pdf_annot_pageFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…