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

Method is_form_pdf

src/__init__.py:5526–5546  ·  view source on GitHub ↗

Either False or PDF field count.

(self)

Source from the content-addressed store, hash-verified

5524
5525 @property
5526 def is_form_pdf(self):
5527 """Either False or PDF field count."""
5528 pdf = _as_pdf_document(self, required=0)
5529 if not pdf.m_internal:
5530 return False
5531 count = -1
5532 try:
5533 fields = mupdf.pdf_dict_getl(
5534 mupdf.pdf_trailer(pdf),
5535 mupdf.PDF_ENUM_NAME_Root,
5536 mupdf.PDF_ENUM_NAME_AcroForm,
5537 mupdf.PDF_ENUM_NAME_Fields,
5538 )
5539 if mupdf.pdf_is_array(fields):
5540 count = mupdf.pdf_array_len(fields)
5541 except Exception:
5542 if g_exceptions_verbose: exception_info()
5543 return False
5544 if count >= 0:
5545 return count
5546 return False
5547
5548 @property
5549 def is_pdf(self):

Callers

nothing calls this directly

Calls 3

_as_pdf_documentFunction · 0.85
exception_infoFunction · 0.85
pdf_trailerMethod · 0.80

Tested by

no test coverage detected