Get CropBox of page number (without loading page).
(self, pno)
| 5955 | return mupdf.pdf_count_pages( self.this) |
| 5956 | |
| 5957 | def page_cropbox(self, pno): |
| 5958 | """Get CropBox of page number (without loading page).""" |
| 5959 | if self.is_closed: |
| 5960 | raise ValueError("document closed") |
| 5961 | this_doc = self.this |
| 5962 | page_count = mupdf.fz_count_pages( this_doc) |
| 5963 | n = pno |
| 5964 | while n < 0: |
| 5965 | n += page_count |
| 5966 | pdf = _as_pdf_document(self) |
| 5967 | if n >= page_count: |
| 5968 | raise ValueError( MSG_BAD_PAGENO) |
| 5969 | pageref = mupdf.pdf_lookup_page_obj( pdf, n) |
| 5970 | cropbox = JM_cropbox(pageref) |
| 5971 | val = JM_py_from_rect(cropbox) |
| 5972 | |
| 5973 | val = Rect(val) |
| 5974 | |
| 5975 | return val |
| 5976 | |
| 5977 | def page_number_from_location(self, page_id): |
| 5978 | """Convert (chapter, pno) to page number.""" |
no test coverage detected