Can someone explain this error and how can I avoid it with
fillable_form.pdf (277.1 KB)?
Using:
import pymupdf
# Load the PDF document containing form fields
doc = pymupdf.open("fillable_form.pdf")
# Iterate through each page of the document
for page in doc:
# Iterate through all widgets (form fields) on the current page
for field in page.widgets():
# Print information about the field
print(f"Field Name: {field.field_name}, Type: {field.field_type_string}, Current Value: {field.field_value}")
doc.close()
Output (4.8 KB):
MuPDF error: argument error: not a dict (string)
MuPDF error: argument error: not a dict (string)
MuPDF error: argument error: not a dict (string)
MuPDF error: argument error: not a dict (string)
MuPDF error: argument error: not a dict (string)
...
Field Name: 1-1-1, Type: Text, Current Value:
Field Name: 1-1-2, Type: Text, Current Value:
Field Name: 1-1-3, Type: Text, Current Value:
Field Name: 1-1-4, Type: Text, Current Value:
Field Name: 1-1-5, Type: Text, Current Value:
Field Name: 1-1-6, Type: Text, Current Value:
Field Name: 1-2-1, Type: Text, Current Value:
Field Name: 1-3-1, Type: Text, Current Value: 123
Field Name: 1-3-2, Type: Text, Current Value: 456
Field Name: 1-3-3, Type: Text, Current Value: 789
Field Name: 1-3-4, Type: Text, Current Value:
Field Name: 1-3-5, Type: Text, Current Value:
Field Name: 1-4-1, Type: Text, Current Value: GREENFIELD FAMILY TRUST
Field Name: 1-5-1, Type: Text, Current Value:
Field Name: 1-6-1, Type: Text, Current Value: 12
Field Name: 1-6-2, Type: Text, Current Value: 345
Field Name: 1-6-3, Type: Text, Current Value: 678
Field Name: 1-6-4, Type: Text, Current Value: 901
Field Name: 1-7-1, Type: Text, Current Value:
Field Name: 1-8-1, Type: Text, Current Value:
Field Name: 1-9-1, Type: Text, Current Value: 45 MARKET STREET
Field Name: 1-10-1, Type: Text, Current Value:
Field Name: 1-11-1, Type: Text, Current Value: SYDNEY
Field Name: 1-11-2, Type: Text, Current Value: NSW
Field Name: 1-11-3, Type: Text, Current Value: 2000
Field Name: 1-12-1, Type: Text, Current Value:
Field Name: 1-13-1, Type: Text, Current Value:
Field Name: 1-14-1, Type: Text, Current Value:
Field Name: 1-15-1, Type: Text, Current Value:
Field Name: 1-15-2, Type: Text, Current Value:
Field Name: 1-15-3, Type: Text, Current Value:
Field Name: 1-16-1, Type: Text, Current Value:
Python 3.13.1 (tags/v3.13.1:0671451, Dec 3 2024, 19:06:28) [MSC v.1942 64 bit (AMD64)] on win32
PyMuPDF 1.26.4