Hi,
I have a problem with Pymupdf redaction. The issue is basically some of the text around the annotated part is also deleted when apply redaction. You can see the example below:

After redaction, it will become:

I follow the instruction to use fitz.TOOLS.set_small_glyph_heights(on=True) and get the following result:

This time the annotated part has been smaller, but still the result is not as I expected:

I get the quads annotations from page.search_for() and add the redaction with page.add_redact_annot().
The code is as below:
page = doc.loadPage(0)
annot = page.firstAnnot
while annot:
page.add_redact_annot(annot.rect, text=None, fontname=None, fontsize=11, align=0, fill=(1, 1, 1), text_color=(0, 0, 0))
annot = annot.next
page.apply_redactions()
Is there anyway to improve this?
And by the way, some of us use Adobe Reader tool to add the annotation manually. Those annotations could not be "squeeze", so the surrounding text is removed unwantedly.
The example below is an annotation made by Adobe Reader Comment tool.

On the Pymupdf it says: "Text removal is done by character: A character is removed if its bbox has a non-empty overlap with a redaction rectangle (changed in MuPDF v1.17)". I guess this is the main issue here. Is there anyway get around this with a fix?
Thanks for your help.
Hi,
I have a problem with Pymupdf redaction. The issue is basically some of the text around the annotated part is also deleted when apply redaction. You can see the example below:
After redaction, it will become:
I follow the instruction to use
fitz.TOOLS.set_small_glyph_heights(on=True)and get the following result:This time the annotated part has been smaller, but still the result is not as I expected:
I get the quads annotations from page.search_for() and add the redaction with page.add_redact_annot().
The code is as below:
Is there anyway to improve this?
And by the way, some of us use Adobe Reader tool to add the annotation manually. Those annotations could not be "squeeze", so the surrounding text is removed unwantedly.
The example below is an annotation made by Adobe Reader Comment tool.

On the Pymupdf it says: "Text removal is done by character: A character is removed if its bbox has a non-empty overlap with a redaction rectangle (changed in MuPDF v1.17)". I guess this is the main issue here. Is there anyway get around this with a fix?
Thanks for your help.