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
We are trying to detect any type of widget and delete it. When we perform the operation page.delete_widget(w) it throws AttributeError: 'Annot' object has no attribute '__del__'
Sample Pdf:
How to reproduce the bug
To Reproduce
PyMuPDF 1.23.25: Python bindings for the MuPDF 1.23.10 library (rebased implementation).
Python 3.11 running on darwin (64-bit).
import fitz
class ModifyPDF:
def __init__(self, input_path, outputFilePath):
self.pdfFilePath = input_path
self.outputFilePath = outputFilePath
def remove_input_fields(self):
docs = fitz.open(self.pdfFilePath)
for page in docs:
w = page.first_widget
while w:
w = page.delete_widget(w)
docs.save(self.outputFilePath, garbage=3, deflate=True, pretty=True)
docs.close()
if __name__ == "__main__":
filePath = "example_form.pdf"
outputPath = "output.pdf"
PdfFunction = ModifyPDF(filePath, outputPath)
PdfFunction.remove_input_fields()
Expected behavior
Widgets should be deleted.
Error output trace:
PyMuPDF version
1.23.25
Operating system
MacOS
Python version
3.11
The text was updated successfully, but these errors were encountered:
Description of the bug
We are trying to detect any type of widget and delete it. When we perform the operation
page.delete_widget(w)
it throws AttributeError:'Annot' object has no attribute '__del__'
Sample Pdf:
How to reproduce the bug
To Reproduce
PyMuPDF 1.23.25: Python bindings for the MuPDF 1.23.10 library (rebased implementation).
Python 3.11 running on darwin (64-bit).
Expected behavior
Widgets should be deleted.
Error output trace:
PyMuPDF version
1.23.25
Operating system
MacOS
Python version
3.11
The text was updated successfully, but these errors were encountered: