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

Method get_layer

src/__init__.py:4843–4863  ·  view source on GitHub ↗

Content of ON, OFF, RBGroups of an OC layer.

(self, config=-1)

Source from the content-addressed store, hash-verified

4841 return glyphs
4842
4843 def get_layer(self, config=-1):
4844 """Content of ON, OFF, RBGroups of an OC layer."""
4845 pdf = _as_pdf_document(self)
4846 ocp = mupdf.pdf_dict_getl(
4847 mupdf.pdf_trailer( pdf),
4848 PDF_NAME('Root'),
4849 PDF_NAME('OCProperties'),
4850 )
4851 if not ocp.m_internal:
4852 return
4853 if config == -1:
4854 obj = mupdf.pdf_dict_get( ocp, PDF_NAME('D'))
4855 else:
4856 obj = mupdf.pdf_array_get(
4857 mupdf.pdf_dict_get( ocp, PDF_NAME('Configs')),
4858 config,
4859 )
4860 if not obj.m_internal:
4861 raise ValueError( MSG_BAD_OC_CONFIG)
4862 rc = JM_get_ocg_arrays( obj)
4863 return rc
4864
4865 def get_layers(self):
4866 """Show optional OC layers."""

Callers 2

test_oc1Function · 0.80
test_3180Function · 0.80

Calls 4

_as_pdf_documentFunction · 0.85
PDF_NAMEFunction · 0.85
JM_get_ocg_arraysFunction · 0.85
pdf_trailerMethod · 0.80

Tested by 2

test_oc1Function · 0.64
test_3180Function · 0.64