__init__ constructor
Leave feedback
On this page
Initializes a new PageAreaRedaction instance.
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). |
from groupdocs.redaction import Redactor
from groupdocs.redaction.redactions import PageAreaRedaction, ReplacementOptions
with Redactor("scan.pdf") as redactor:
redactor.apply(
PageAreaRedaction(r"\d{3}-\d{2}-\d{4}", ReplacementOptions("[SSN]"))
)
redactor.save()
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). |
from groupdocs.redaction import Redactor
from groupdocs.redaction.redactions import PageAreaRedaction, ReplacementOptions, RegionReplacementOptions
from groupdocs.pydrawing import Color, Size
redactor = Redactor("scan.pdf")
redactor.apply(
PageAreaRedaction(
r"\d{3}-\d{2}-\d{4}",
ReplacementOptions("[SSN]"),
RegionReplacementOptions(Color.BLACK, Size(120, 20))
)
)
redactor.save()
- class
PageAreaRedaction
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.