__init__ constructor

On this page

init

Initializes a new PageAreaRedaction.

def __init__(self, regex, options):
    ...
Parameter Type Description
regex System.Text.RegularExpressions.Regex Regular expression to search and replace.
options ReplacementOptions Replacement options (textual, color).

init

Initializes a new PageAreaRedaction.

def __init__(self, regex, options, image_options):
    ...
Parameter Type Description
regex System.Text.RegularExpressions.Regex Regular expression to search and replace.
options ReplacementOptions Replacement options (textual, color).
image_options RegionReplacementOptions Replacement options (image area).

Example

from groupdocs.redaction import Redactor
from groupdocs.redaction.redactions import PageAreaRedaction, ReplacementOptions, RegionReplacementOptions
from groupdocs.redaction.options.drawing import Color, Size

with Redactor("scan.pdf") as redactor:
    text_opts = ReplacementOptions("[SSN]")
    image_opts = RegionReplacementOptions(Color.black, Size(120, 20))
    redactor.apply(PageAreaRedaction(r"\d{3}-\d{2}-\d{4}", text_opts, image_opts))
    redactor.save()

See Also

On this page