IRedactionCallback class
Leave feedback
On this page
Defines methods required for receiving information on each redaction change and optionally preventing it.
Learn more:
- More details about implementing
IRedactionCallbackinterface: https://docs.groupdocs.com/redaction/net/use-redaction-callback/
The IRedactionCallback type exposes the following members:
| Method | Description |
|---|---|
| accept_redaction | Triggers right before applying any redaction to the document, allowing logging or forbidding it. |
| accept_redaction_redaction_description |
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()
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.