Skip to content

Annotation redaction creating unwanted white rectangles #2470

@luclemot

Description

@luclemot

Bug description

Hi !
I'm getting a similar issue than on this stackoverflow question.
While trying to redact some text from a relatively dense pdf, the redaction works well but it adds an extra white rectangle per redaction which covers text I don't want redacted.

How it happened

I simply ran the following lines for each rectangle I wanted redacted:

page.add_redact_annot(rect, fill=white)
page.apply_redactions()

From my attempt at debugging this issue, it seems like the add_redact_annot is working fine (it crosses off the right rectangle when commenting out the next line) and that the issue comes from the apply_redactions method.

Outputs

Below is the result redaction. The text in red is replacement text I added. On the overlined screenshot, you can see the unwanted white rectangle.

image

image

Your configuration

  • Ubuntu
  • Python 3.10
  • PyMuPDF==1.22.3

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions