(self, buffer_, rect=0)
| 657 | return r |
| 658 | |
| 659 | def _setAP(self, buffer_, rect=0): |
| 660 | try: |
| 661 | annot = self.this |
| 662 | annot_obj = mupdf.pdf_annot_obj( annot) |
| 663 | page = _pdf_annot_page(annot) |
| 664 | apobj = mupdf.pdf_dict_getl( annot_obj, PDF_NAME('AP'), PDF_NAME('N')) |
| 665 | if not apobj.m_internal: |
| 666 | raise RuntimeError( MSG_BAD_APN) |
| 667 | if not mupdf.pdf_is_stream( apobj): |
| 668 | raise RuntimeError( MSG_BAD_APN) |
| 669 | res = JM_BufferFromBytes( buffer_) |
| 670 | if not res.m_internal: |
| 671 | raise ValueError( MSG_BAD_BUFFER) |
| 672 | JM_update_stream( page.doc(), apobj, res, 1) |
| 673 | if rect: |
| 674 | bbox = mupdf.pdf_dict_get_rect( annot_obj, PDF_NAME('Rect')) |
| 675 | mupdf.pdf_dict_put_rect( apobj, PDF_NAME('BBox'), bbox) |
| 676 | except Exception: |
| 677 | if g_exceptions_verbose: exception_info() |
| 678 | |
| 679 | def _update_appearance(self, opacity=-1, blend_mode=None, fill_color=None, rotate=-1): |
| 680 | annot = self.this |
no test coverage detected