Get xref of page number.
(self, pno)
| 5989 | return page_n |
| 5990 | |
| 5991 | def page_xref(self, pno): |
| 5992 | """Get xref of page number.""" |
| 5993 | if g_use_extra: |
| 5994 | return extra.page_xref( self.this, pno) |
| 5995 | if self.is_closed: |
| 5996 | raise ValueError("document closed") |
| 5997 | page_count = mupdf.fz_count_pages(self.this) |
| 5998 | n = pno |
| 5999 | while n < 0: |
| 6000 | n += page_count |
| 6001 | pdf = _as_pdf_document(self) |
| 6002 | xref = 0 |
| 6003 | if n >= page_count: |
| 6004 | raise ValueError( MSG_BAD_PAGENO) |
| 6005 | xref = mupdf.pdf_to_num(mupdf.pdf_lookup_page_obj(pdf, n)) |
| 6006 | return xref |
| 6007 | |
| 6008 | @property |
| 6009 | def pagelayout(self) -> str: |
no test coverage detected