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

Method add_line_annot

src/__init__.py:10448–10457  ·  view source on GitHub ↗

Add a 'Line' annotation.

(self, p1: point_like, p2: point_like)

Source from the content-addressed store, hash-verified

10446 return annot
10447
10448 def add_line_annot(self, p1: point_like, p2: point_like) -> Annot:
10449 """Add a 'Line' annotation."""
10450 old_rotation = annot_preprocess(self)
10451 try:
10452 annot = self._add_line_annot(p1, p2)
10453 finally:
10454 if old_rotation != 0:
10455 self.set_rotation(old_rotation)
10456 annot_postprocess(self, annot)
10457 return annot
10458
10459 def add_polygon_annot(self, points: list) -> Annot:
10460 """Add a 'Polygon' annotation."""

Callers 3

test_lineFunction · 0.80
test_3131Function · 0.80
new-annots.pyFile · 0.80

Calls 4

_add_line_annotMethod · 0.95
set_rotationMethod · 0.95
annot_preprocessFunction · 0.85
annot_postprocessFunction · 0.85

Tested by 2

test_lineFunction · 0.64
test_3131Function · 0.64