AnnotationRedaction

AnnotationRedaction class

Represents a redaction that replaces annotation text (comments, etc.) matching a given regular expression.

public class AnnotationRedaction : Redaction

Constructors

Name Description
AnnotationRedaction(Regex, string) Initializes a new instance of AnnotationRedaction class.
AnnotationRedaction(string, string) Initializes a new instance of AnnotationRedaction class.

Properties

Name Description
override Description { get; } Returns a string, describing the redaction and its parameters.
Expression { get; } Gets the regular expression to match.
Replacement { get; } Gets a textual replacement for matched text.

Methods

Name Description
override ApplyTo(DocumentFormatInstance) Applies the redaction to a given format instance.

Remarks

Learn more

Examples

The following example demonstrates how to replace the name “John” with “[redacted]” in all annotations.

using (Redactor redactor = new Redactor(@"C:\test.pdf"))
{
   redactor.Apply(new AnnotationRedaction("(?im:john)", "[redacted]"));
   redactor.Save()
}

See Also