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
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.
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
The text was updated successfully, but these errors were encountered:
I thought your rects array was dubious. This worked for me:
import pymupdf
doc = pymupdf.open("redactions_error_sample.pdf")
page = doc.load_page(0)
rects = [[164,213,282,227],[282,213,397,233],[434,209,525,243],[169,228,231,243],[377,592,440,607],[373,611,444,626]]
for rect in rects:
page.add_redact_annot(rect, fill=(1,0,0))
# Apply the redactions to the current page, but ignore images
page.apply_redactions(images=0)
doc.save("after_apply_redactions.pdf")
doc.close()
Description of the bug
My pymupdf version is 1.24.14.
I tried invoke
add_redact_annot(rect)
andapply_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
PyMuPDF version
1.24.14
Operating system
MacOS
Python version
3.9
The text was updated successfully, but these errors were encountered: