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

Method add_rect_annot

src/__init__.py:10481–10490  ·  view source on GitHub ↗

Add a 'Square' (rectangle) annotation.

(self, rect: rect_like)

Source from the content-addressed store, hash-verified

10479 return annot
10480
10481 def add_rect_annot(self, rect: rect_like) -> Annot:
10482 """Add a 'Square' (rectangle) annotation."""
10483 old_rotation = annot_preprocess(self)
10484 try:
10485 annot = self._add_square_or_circle(rect, mupdf.PDF_ANNOT_SQUARE)
10486 finally:
10487 if old_rotation != 0:
10488 self.set_rotation(old_rotation)
10489 annot_postprocess(self, annot)
10490 return annot
10491
10492 def add_redact_annot(
10493 self,

Callers 2

test_squareFunction · 0.80
new-annots.pyFile · 0.80

Calls 4

_add_square_or_circleMethod · 0.95
set_rotationMethod · 0.95
annot_preprocessFunction · 0.85
annot_postprocessFunction · 0.85

Tested by 1

test_squareFunction · 0.64