MCPcopy Index your code
hub / github.com/pymupdf/PyMuPDF / get_outline_xrefs

Method get_outline_xrefs

src/__init__.py:5031–5047  ·  view source on GitHub ↗

Get list of outline xref numbers.

(self)

Source from the content-addressed store, hash-verified

5029 return {"xref": xref, "ocgs": ocgs, "policy": policy, "ve": ve}
5030
5031 def get_outline_xrefs(self):
5032 """Get list of outline xref numbers."""
5033 xrefs = []
5034 pdf = _as_pdf_document(self, required=0)
5035 if not pdf.m_internal:
5036 return xrefs
5037 root = mupdf.pdf_dict_get(mupdf.pdf_trailer(pdf), PDF_NAME('Root'))
5038 if not root.m_internal:
5039 return xrefs
5040 olroot = mupdf.pdf_dict_get(root, PDF_NAME('Outlines'))
5041 if not olroot.m_internal:
5042 return xrefs
5043 first = mupdf.pdf_dict_get(olroot, PDF_NAME('First'))
5044 if not first.m_internal:
5045 return xrefs
5046 xrefs = JM_outline_xrefs(first, xrefs)
5047 return xrefs
5048
5049 def get_page_fonts(self, pno: int, full: bool =False) -> list:
5050 """Retrieve a list of fonts used on a page.

Callers 5

del_toc_itemMethod · 0.95
delete_pagesMethod · 0.95
set_toc_itemMethod · 0.80
del_toc_itemFunction · 0.80
set_toc_itemFunction · 0.80

Calls 4

_as_pdf_documentFunction · 0.85
PDF_NAMEFunction · 0.85
JM_outline_xrefsFunction · 0.85
pdf_trailerMethod · 0.80

Tested by

no test coverage detected