Description
Description of the bug
My pymupdf version is 1.24.14.
I tried invoke add_redact_annot(rect)
and apply_redactions(images=0)
to remove some words from original pdf file. The locations are shown as below:
However words remanins in these rect areas. Meanwhile some other words were removed unexpectly. The result is shown
as below:
I also attached the files mentioned above, along with the rect positions.
original pdf file: redactions_error_sample.pdf
result file after add_redact_annot(rect)
:
before_apply_redactions.pdf
result after apply_redactions(images=0)
:
after_apply_redactions.pdf
rect areas: [{"rect":[164,213,282,227]},{"rect":[282,213,397,233]},{"rect":[434,209,525,243]},{"rect":[169,228,231,243]},{"rect":[377,592,440,607]},{"rect":[373,611,444,626]}]
How to reproduce the bug
doc = fitz.open("redactions_error_sample.pdf")
page = doc.load_page(0)
for rect in rects:
page.add_redact_annot(rect)
doc.save("before_apply_redactions.pdf")
page.apply_redactions(images=0)
doc.save("after_apply_redactions.pdf")
PyMuPDF version
1.24.14
Operating system
MacOS
Python version
3.9