IRedactionCallback class

IRedactionCallback class

Defines methods required for receiving information on each redaction change and optionally preventing it.

Learn more:

The IRedactionCallback type exposes the following members:

Methods

Method Description
accept_redaction Triggers right before applying any redaction to the document, allowing logging or forbidding it.
accept_redaction_redaction_description

Example

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()

See Also