RedactorSettings class

RedactorSettings class

Represents redaction settings, allowing to customize the redaction process.

Learn more

The RedactorSettings type exposes the following members:

Constructors

Constructor Description
init Initializes a new instance of the RedactorSettings class.
init Initializes a new RedactorSettings instance with a given ILogger instance.
init Initializes a new instance of the RedactorSettings class with a given IRedactionCallback instance.
init Initializes a new RedactorSettings instance with the specified IOcrConnector.
init Initializes a new RedactorSettings instance with the specified logger and callback.
init Initializes a new instance of the RedactorSettings class with given ILogger, IRedactionCallback and IOcrConnector instances.

Properties

Property Description
logger The logger used for logging events and errors. Must be an instance of a class implementing ILogger.
ocr_connector The OCR connector instance implementing IOcrConnector.
redaction_callback The redaction callback used to evaluate each 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