Skip to content

Redaction removing more text than expected #2108

@seb-bau

Description

@seb-bau

Describe the bug (mandatory)

When applying a redaction on a document, the following word is removed as well.

To Reproduce (mandatory)

Example PDF file: test_doc.pdf

Run this script:

import fitz
doc = fitz.open("test_doc.pdf")
page = doc[0]
areas = page.search_for("{sig}")
rect = areas[0]
page.add_redact_annot(rect)
page.apply_redactions()
doc.saveIncr()
doc.close()

The searched word "{sig}" is removed (as expected).
The word "Vertrag" on the top right is removed as well (unexpected).

Expected behavior (optional)

Searched string should be removed. No other change should be made.

Screenshots (optional)

Before script:
grafik
After script:
grafik

Your configuration (mandatory)

  • OS independant, happening on Windows 11 as well as Debian 11
  • Python Python 3.10.8
  • PyMuPDF 1.21.0, installed via pip

Thank you!

Metadata

Metadata

Assignees

Labels

upstream bugbug outside this package

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions