Unwanted white space after apply redactions #4709
-
Hi, thanks for the library, which is great. Currently I'm using this library for document translation, and I ran into an issue when wiping out the original text and insert the new translated text. I'm using
And the result is that the original text is removed, but sometimes it lefts a white rectangle after applying redactions, see below. ![]() And the original text and rect is shown below. Most of the times it works, but sometimes it doesn't. For example, only two of the redacted boxes have the unwanted white rectangles, as highlighted with blue rectangles below: I believe my issue is related to this discussion. I have tried disable the color filling by using: However, none of the methods above works and the issue persists. My Configuration
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
The issue is not how you are adding the redactions annotations. The redaction annotations merely describe the area that you want to remove content within. The issue comes with how you apply the redactions. page.apply_redactions(images=0, graphics=0, text = PDF_REDACT_REMOVE) That will leave images and graphics untouched, while still removing the text. Please let us know whether that solves the problem for you. |
Beta Was this translation helpful? Give feedback.
The issue is not how you are adding the redactions annotations.
The redaction annotations merely describe the area that you want to remove content within.
The issue comes with how you apply the redactions.
page.apply_redactions(images=0, graphics=0, text = PDF_REDACT_REMOVE)
That will leave images and graphics untouched, while still removing the text.
Please let us know whether that solves the problem for you.