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

Method add_polygon_annot

src/__init__.py:10459–10468  ·  view source on GitHub ↗

Add a 'Polygon' annotation.

(self, points: list)

Source from the content-addressed store, hash-verified

10457 return annot
10458
10459 def add_polygon_annot(self, points: list) -> Annot:
10460 """Add a 'Polygon' annotation."""
10461 old_rotation = annot_preprocess(self)
10462 try:
10463 annot = self._add_multiline(points, mupdf.PDF_ANNOT_POLYGON)
10464 finally:
10465 if old_rotation != 0:
10466 self.set_rotation(old_rotation)
10467 annot_postprocess(self, annot)
10468 return annot
10469
10470 def add_polyline_annot(self, points: list) -> Annot:
10471 """Add a 'PolyLine' annotation."""

Callers 2

test_polygonFunction · 0.80
new-annots.pyFile · 0.80

Calls 4

_add_multilineMethod · 0.95
set_rotationMethod · 0.95
annot_preprocessFunction · 0.85
annot_postprocessFunction · 0.85

Tested by 1

test_polygonFunction · 0.64