DeleteAnnotationRedaction
Leave feedback
On this page
Represents a text redaction that deletes annotations if text is matching given regular expression (optionally deletes all annotations).
public class DeleteAnnotationRedaction : Redaction
| Name | Description |
|---|---|
| DeleteAnnotationRedaction() | Initializes a new instance of DeleteAnnotationRedaction class, with settings to delete all annotations (matching everything). |
| DeleteAnnotationRedaction(Regex) | Initializes a new instance of DeleteAnnotationRedaction class, deleting annotations matching given expression. |
| DeleteAnnotationRedaction(string) | Initializes a new instance of DeleteAnnotationRedaction class, deleting annotations matching given expression. |
| Name | Description |
|---|---|
| override Description { get; } | Returns a string, describing the redaction and its parameters. |
| Expression { get; } | Gets the regular expression to match. |
| Name | Description |
|---|---|
| override ApplyTo(DocumentFormatInstance) | Applies the redaction to a given format instance. |
Learn more
- More details about applying redactions: Redaction basics
- More details about document annotation redactions: Annotation redactions
The following example demonstrates how to remove all annotations containing words “use”, “show” or “describe” from document (and leave others).
using (Redactor redactor = new Redactor(@"D:\test.docx"))
{
redactor.Apply(new DeleteAnnotationRedaction("(?im:(use|show|describe))"));
redactor.Save()
}
- class Redaction
- namespace GroupDocs.Redaction.Redactions
- assembly GroupDocs.Redaction
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.