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

Method xref_xml_metadata

src/__init__.py:8114–8124  ·  view source on GitHub ↗

Get xref of document XML metadata.

(self)

Source from the content-addressed store, hash-verified

8112 return r
8113
8114 def xref_xml_metadata(self):
8115 """Get xref of document XML metadata."""
8116 pdf = _as_pdf_document(self)
8117 root = mupdf.pdf_dict_get( mupdf.pdf_trailer( pdf), PDF_NAME('Root'))
8118 if not root.m_internal:
8119 RAISEPY( MSG_BAD_PDFROOT, JM_Exc_FileDataError)
8120 xml = mupdf.pdf_dict_get( root, PDF_NAME('Metadata'))
8121 xref = 0
8122 if xml.m_internal:
8123 xref = mupdf.pdf_to_num( xml)
8124 return xref
8125
8126 __slots__ = ('this', 'page_count2', 'this_is_pdf', '__dict__')
8127

Callers

nothing calls this directly

Calls 4

_as_pdf_documentFunction · 0.85
PDF_NAMEFunction · 0.85
RAISEPYFunction · 0.85
pdf_trailerMethod · 0.80

Tested by

no test coverage detected