accept_redaction method
Leave feedback
On this page
Triggered 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 the 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.options import LoadOptions, RedactorSettings
from groupdocs.redaction.redactions import ExactPhraseRedaction, ReplacementOptions
class RedactionLogger:
def accept_redaction(self, description):
print(f"{description.redaction_type.name} redaction, original text: {description.original_text}")
return True
settings = RedactorSettings(RedactionLogger())
with Redactor("sample.docx", LoadOptions(), settings) as redactor:
redactor.apply(ExactPhraseRedaction("Emily Johnson", ReplacementOptions("[personal]")))
redactor.save()
These names call accept_redaction too, limited to the overloads listed.
| Alias | Accepts |
|---|---|
accept_redaction_redaction_description |
accept_redaction_redaction_description(description) |
- 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.