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

Method FormFonts

src/__init__.py:4125–4143  ·  view source on GitHub ↗

Get list of field font resource names.

(self)

Source from the content-addressed store, hash-verified

4123
4124 @property
4125 def FormFonts(self):
4126 """Get list of field font resource names."""
4127 pdf = _as_pdf_document(self, required=0)
4128 if not pdf.m_internal:
4129 return
4130 fonts = mupdf.pdf_dict_getl(
4131 mupdf.pdf_trailer(pdf),
4132 PDF_NAME('Root'),
4133 PDF_NAME('AcroForm'),
4134 PDF_NAME('DR'),
4135 PDF_NAME('Font'),
4136 )
4137 liste = list()
4138 if fonts.m_internal and mupdf.pdf_is_dict(fonts): # fonts exist
4139 n = mupdf.pdf_dict_len(fonts)
4140 for i in range(n):
4141 f = mupdf.pdf_dict_get_key(fonts, i)
4142 liste.append(JM_UnicodeFromStr(mupdf.pdf_to_name(f)))
4143 return liste
4144
4145 def add_layer(self, name, creator=None, on=None):
4146 """Add a new OC layer."""

Callers

nothing calls this directly

Calls 5

_as_pdf_documentFunction · 0.85
PDF_NAMEFunction · 0.85
JM_UnicodeFromStrFunction · 0.85
pdf_trailerMethod · 0.80
appendMethod · 0.45

Tested by

no test coverage detected