You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Trying to loop through all widgets in a PDF, and make fields that are previously marked as read only, editable.
I have a hard time making an actual sample, both because I am not sure what should have worked, and because I am fumbling in the dark here.
But, I read in a PDF with read-only fields, I have tried things like
for page in pdf:
widgets: Iterable[fitz.Widget] = page.widgets()
for field in widgets:
if fitz.PDF_FIELD_IS_READ_ONLY & field.field_flags:
print("Field is readonly")
field.field_flags = field.field_flags - fitz.PDF_FIELD_IS_READ_ONLY
field.update()
pdf.save("filename.pdf")
When I then reopen the PDF, the fields are still read only.
If I try the opposite, to set all fields read only, that works.
PyMuPDF==1.18.15
The text was updated successfully, but these errors were encountered:
Trying to loop through all widgets in a PDF, and make fields that are previously marked as read only, editable.
I have a hard time making an actual sample, both because I am not sure what should have worked, and because I am fumbling in the dark here.
But, I read in a PDF with read-only fields, I have tried things like
When I then reopen the PDF, the fields are still read only.
If I try the opposite, to set all fields read only, that works.
PyMuPDF==1.18.15
The text was updated successfully, but these errors were encountered: