(self, list)
| 9645 | return val |
| 9646 | |
| 9647 | def _add_ink_annot(self, list): |
| 9648 | page = _as_pdf_page(self.this) |
| 9649 | if not PySequence_Check(list): |
| 9650 | raise ValueError( MSG_BAD_ARG_INK_ANNOT) |
| 9651 | ctm = mupdf.FzMatrix() |
| 9652 | mupdf.pdf_page_transform(page, mupdf.FzRect(0), ctm) |
| 9653 | inv_ctm = mupdf.fz_invert_matrix(ctm) |
| 9654 | annot = mupdf.pdf_create_annot(page, mupdf.PDF_ANNOT_INK) |
| 9655 | annot_obj = mupdf.pdf_annot_obj(annot) |
| 9656 | n0 = len(list) |
| 9657 | inklist = mupdf.pdf_new_array(page.doc(), n0) |
| 9658 | |
| 9659 | for j in range(n0): |
| 9660 | sublist = list[j] |
| 9661 | n1 = len(sublist) |
| 9662 | stroke = mupdf.pdf_new_array(page.doc(), 2 * n1) |
| 9663 | |
| 9664 | for i in range(n1): |
| 9665 | p = sublist[i] |
| 9666 | if not PySequence_Check(p) or PySequence_Size(p) != 2: |
| 9667 | raise ValueError( MSG_BAD_ARG_INK_ANNOT) |
| 9668 | point = mupdf.fz_transform_point(JM_point_from_py(p), inv_ctm) |
| 9669 | mupdf.pdf_array_push_real(stroke, point.x) |
| 9670 | mupdf.pdf_array_push_real(stroke, point.y) |
| 9671 | |
| 9672 | mupdf.pdf_array_push(inklist, stroke) |
| 9673 | |
| 9674 | mupdf.pdf_dict_put(annot_obj, PDF_NAME('InkList'), inklist) |
| 9675 | mupdf.pdf_update_annot(annot) |
| 9676 | JM_add_annot_id(annot, "A") |
| 9677 | return Annot(annot) |
| 9678 | |
| 9679 | def _add_line_annot(self, p1, p2): |
| 9680 | page = self._pdf_page() |
no test coverage detected