Set annotation rectangle.
(self, rect)
| 1527 | mupdf.pdf_set_annot_popup(annot, r) |
| 1528 | |
| 1529 | def set_rect(self, rect): |
| 1530 | """Set annotation rectangle.""" |
| 1531 | CheckParent(self) |
| 1532 | annot = self.this |
| 1533 | |
| 1534 | pdfpage = _pdf_annot_page(annot) |
| 1535 | rot = JM_rotate_page_matrix(pdfpage) |
| 1536 | r = mupdf.fz_transform_rect(JM_rect_from_py(rect), rot) |
| 1537 | if mupdf.fz_is_empty_rect(r) or mupdf.fz_is_infinite_rect(r): |
| 1538 | raise ValueError( MSG_BAD_RECT) |
| 1539 | try: |
| 1540 | mupdf.pdf_set_annot_rect(annot, r) |
| 1541 | except Exception as e: |
| 1542 | message(f'cannot set rect: {e}') |
| 1543 | return False |
| 1544 | |
| 1545 | def set_rotation(self, rotate=0): |
| 1546 | """Set annotation rotation.""" |
no test coverage detected