-
Couldn't load subscription status.
- Fork 658
Closed
Labels
not a bugnot a bug / user error / unable to reproducenot a bug / user error / unable to reproduce
Description
Description of the bug
I am using a script to automatically fill in a PDF form with widgets. In the form I am filling out, there are character counters next to each text input widget. The counters get updated automatically when I input the text using Adobe Acrobat, but this does not happen when I update the value of the text widget using PyMuPDF. Upon further inspection, I discovered that widget.script_calc returns None for the fields that clearly have a counter implemented.
How to reproduce the bug
Here is a sample code:
with fitz.open(form_path) as doc:
for page in doc:
for widget in page.widgets():
if widget.field_name == "WbsoProjectomschrijving":
widget.field_value = "hello world"
print(f"{widget.field_name=}, {widget.field_value=}, {widget.script_calc=}")
if widget.field_name == "tellerProjectomschrijving":
print(f"{widget.field_name=}, {widget.field_value=}, {widget.script_calc=}")
widget.update()
doc.save(output_path)
PyMuPDF version
1.26.4
Operating system
Windows
Python version
3.11
Metadata
Metadata
Assignees
Labels
not a bugnot a bug / user error / unable to reproducenot a bug / user error / unable to reproduce