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

Method delete_annot

src/__init__.py:10869–10890  ·  view source on GitHub ↗

Delete annot and return next one.

(self, annot)

Source from the content-addressed store, hash-verified

10867 return self.cropbox.tl
10868
10869 def delete_annot(self, annot):
10870 """Delete annot and return next one."""
10871 CheckParent(self)
10872 CheckParent(annot)
10873
10874 page = self._pdf_page()
10875 while 1:
10876 # first loop through all /IRT annots and remove them
10877 irt_annot = JM_find_annot_irt(annot.this)
10878 if not irt_annot: # no more there
10879 break
10880 mupdf.pdf_delete_annot(page, irt_annot.this)
10881 nextannot = mupdf.pdf_next_annot(annot.this) # store next
10882 mupdf.pdf_delete_annot(page, annot.this)
10883 val = Annot(nextannot)
10884
10885 if val:
10886 val.thisown = True
10887 val.parent = weakref.proxy(self) # owning page object
10888 val.parent._annot_refs[id(val)] = val
10889 annot._erase()
10890 return val
10891
10892 def delete_image(page: 'Page', xref: int):
10893 """Delete the image referred to by xef.

Callers 3

delete_widgetMethod · 0.80
delete_widgetFunction · 0.80
test_strikeoutFunction · 0.80

Calls 5

_pdf_pageMethod · 0.95
CheckParentFunction · 0.85
JM_find_annot_irtFunction · 0.85
AnnotClass · 0.85
_eraseMethod · 0.45

Tested by 1

test_strikeoutFunction · 0.64