__init__ constructor

init

Initializes a new DeleteAnnotationRedaction instance that deletes all annotations (matches everything).

def __init__(self):
    ...

init

Initializes a new instance of DeleteAnnotationRedaction class, deleting annotations matching the given regular expression.

def __init__(self, pattern):
    ...
Parameter Type Description
pattern str Regular expression.

Example

    from groupdocs.redaction import Redactor
    from groupdocs.redaction.redactions import DeleteAnnotationRedaction

    with Redactor("document.pdf") as redactor:
        redactor.apply(DeleteAnnotationRedaction("(?i)internal"))
        redactor.save()
    ```

## __init__ {#regex}

Initializes a new instance of DeleteAnnotationRedaction class, deleting annotations matching given expression.

```python
def __init__(self, regex):
    ...
Parameter Type Description
regex System.Text.RegularExpressions.Regex Regular expression.

Example

from groupdocs.redaction.redactions import DeleteAnnotationRedaction

# Delete annotations whose text matches the case‑insensitive pattern "internal"
del_red = DeleteAnnotationRedaction("(?i)internal")

See Also