Skip to content

page.widgets() crashes on XFA forms #4965

@yurivict

Description

@yurivict

Description of the bug

Testcase: f1040.pdf.

script:

import pymupdf

# Open the PDF file
doc = pymupdf.open("f1040.pdf")

for page in doc:
    print(f"--- Page {page.number} ---")
    # Iterate over all form fields (widgets) on the page
    for field in page.widgets():
        # Access field properties
        name = field.field_name       # The internal name of the field
        value = field.field_value     # The data currently in the field
        f_type = field.field_type      # Integer representing the field type
        
        print(f"Field Name: {name}")
        print(f"Field Value: {value}")
        print(f"Field Type: {f_type}")
        print("-" * 20)

doc.close()

How to reproduce the bug

see above

PyMuPDF version

1.27.2.2

Operating system

Other

Python version

3.11

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions