Add a 'FileAttachment' annotation.
(
self,
point: point_like,
buffer_: ByteString,
filename: str,
ufilename: OptStr =None,
desc: OptStr =None,
icon: OptStr =None
)
| 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, |