accept_redaction method
Leave feedback
On this page
Triggers right before applying any redaction to the document, allowing logging or forbidding it.
def accept_redaction(self, description):
...
| Parameter | Type | Description |
|---|---|---|
| description | RedactionDescription |
Contains information about particular match type, criteria, text and position. |
Returns: bool: True to accept the redaction, False to decline it.
from groupdocs.redaction import Redactor
from groupdocs.redaction.redactions import ExactPhraseRedaction, ReplacementOptions
from groupdocs.redaction.options import LoadOptions, RedactorSettings
def accept(description):
# description.original_text, .redaction_type, .action_type
return "keep-me" not in (description.original_text or "")
with Redactor("document.docx", LoadOptions(), RedactorSettings(callback=accept)) as redactor:
redactor.apply(ExactPhraseRedaction("secret", ReplacementOptions("[X]")))
redactor.save()
- class
IRedactionCallback
Was this page helpful?
Any additional feedback you'd like to share with us?
Please tell us how we can improve this page.
Thank you for your feedback!
We value your opinion. Your feedback will help us improve our documentation.