Triggered right before applying any redaction to the document, allowing logging or forbidding it.
Example
fromgroupdocs.redactionimportRedactorfromgroupdocs.redaction.optionsimportLoadOptions,RedactorSettingsfromgroupdocs.redaction.redactionsimportExactPhraseRedaction,ReplacementOptionsclassRedactionDump(object):defaccept_redaction(self,description):print(f"{description.redaction_type} redaction, "f"{description.action_type} action, "f"item {description.original_text}. ",end='')ifdescription.replacementisnotNone:print(f"Text {description.replacement.original_text} is replaced with "f"{description.replacement.replacement}. ",end='')print()# Return False to prevent this change during the redaction processreturnTrue# Pass an instance to RedactorSettings, the third Redactor argumentwithRedactor("sample.docx",LoadOptions(),RedactorSettings(RedactionDump()))asredactor:redactor.apply(ExactPhraseRedaction("Emily Johnson",ReplacementOptions("[personal]")))redactor.save()