MCPcopy Create free account
hub / github.com/pymupdf/PyMuPDF / _pdf_annot_page

Function _pdf_annot_page

src/__init__.py:563–575  ·  view source on GitHub ↗

Wrapper for mupdf.pdf_annot_page() which raises an exception if is not bound to a page instead of returning a mupdf.PdfPage with `.m_internal=None`. [Some other MuPDF functions such as pdf_update_annot()` already raise a similar exception if a pdf_annot's .page field is

(annot)

Source from the content-addressed store, hash-verified

561
562
563def _pdf_annot_page(annot):
564 '''
565 Wrapper for mupdf.pdf_annot_page() which raises an exception if <annot>
566 is not bound to a page instead of returning a mupdf.PdfPage with
567 `.m_internal=None`.
568
569 [Some other MuPDF functions such as pdf_update_annot()` already raise a
570 similar exception if a pdf_annot&#x27;s .page field is null.]
571 ''&#x27;
572 page = mupdf.pdf_annot_page(annot)
573 if not page.m_internal:
574 raise RuntimeError('Annot is not bound to a page')
575 return page
576
577
578# Fixme: we don't support JM_MEMORY=1.

Callers 13

_setAPMethod · 0.85
_update_appearanceMethod · 0.85
delete_responsesMethod · 0.85
get_parentMethod · 0.85
set_irt_xrefMethod · 0.85
set_opacityMethod · 0.85
set_popupMethod · 0.85
set_rectMethod · 0.85
verticesMethod · 0.85
JM_add_annot_idFunction · 0.85
JM_find_annot_irtFunction · 0.85
JM_get_widget_propertiesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…