Return the first annotation whose /IRT key ("In Response To") points to annot. Used to remove the response chain of a given annotation.
(annot)
| 19377 | |
| 19378 | |
| 19379 | def 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 | |
| 19406 | def JM_font_ascender(font): |
no test coverage detected
searching dependent graphs…