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

Method add_file_annot

src/__init__.py:10351–10374  ·  view source on GitHub ↗

Add a 'FileAttachment' annotation.

(
            self,
            point: point_like,
            buffer_: ByteString,
            filename: str,
            ufilename: OptStr =None,
            desc: OptStr =None,
            icon: OptStr =None
            )

Source from the content-addressed store, hash-verified

10349 return annot
10350
10351 def add_file_annot(
10352 self,
10353 point: point_like,
10354 buffer_: ByteString,
10355 filename: str,
10356 ufilename: OptStr =None,
10357 desc: OptStr =None,
10358 icon: OptStr =None
10359 ) -> Annot:
10360 """Add a 'FileAttachment' annotation."""
10361 old_rotation = annot_preprocess(self)
10362 try:
10363 annot = self._add_file_annot(point,
10364 buffer_,
10365 filename,
10366 ufilename=ufilename,
10367 desc=desc,
10368 icon=icon,
10369 )
10370 finally:
10371 if old_rotation != 0:
10372 self.set_rotation(old_rotation)
10373 annot_postprocess(self, annot)
10374 return annot
10375
10376 def add_freetext_annot(
10377 self,

Callers 3

test_fileattachmentFunction · 0.80
test_4590Function · 0.80
new-annots.pyFile · 0.80

Calls 4

_add_file_annotMethod · 0.95
set_rotationMethod · 0.95
annot_preprocessFunction · 0.85
annot_postprocessFunction · 0.85

Tested by 2

test_fileattachmentFunction · 0.64
test_4590Function · 0.64