Annotation redactions

View as MarkdownMarkdown

Set up your AI agent

Give your coding agent live access to the GroupDocs documentation and API reference through the GroupDocs Docs MCP server — no install, no API key. Learn more

claude mcp add --transport http groupdocs-docs https://docs.groupdocs.com/mcp

Also process documents locally

The GroupDocs.Redaction MCP server lets your agent work with files on your machine; they are never uploaded. It needs the .NET 10 SDK or Docker.

claude mcp add groupdocs-redaction -- dnx GroupDocs.Redaction.Mcp --yes
Folders, licensing and more →

Remove annotations (comments etc)

You can use GroupDocs.Redaction to remove all or specific comments and other annotations from the document. For example, we can remove all comments from the document, containing texts like “use”, “show” or “describe” in its body:

const redaction = require('@groupdocs/groupdocs.redaction');

const redactor = new redaction.Redactor('annotated_sample.xlsx');
try 
{
    redactor.apply(new redaction.DeleteAnnotationRedaction('(?im:(use|show|describe))'));
const options = new redaction.SaveOptions();
    options.setAddSuffix(true);
    options.setRasterizeToPDF(false);
    redactor.save(options);
}
finally {
  redactor.close();
}

annotated.xlsx is the sample file used in this example. Click here to download it.

Binary file (XLSX, 12 KB)

Download full output

You can use constructor without arguments to remove all annotations within the document.

Redact annotations

Instead of removing all or specific annotations, you can remove sensitive data from the annotation text. For instance, we can remove all mentions of “John” in the given document, e.g.:

const redaction = require('@groupdocs/groupdocs.redaction');

const redactor = new redaction.Redactor('annotated_sample.xlsx');
try 
{
    redactor.apply(new redaction.AnnotationRedaction('(?im:john)', '[redacted]'));
const options = new redaction.SaveOptions();
    options.setAddSuffix(true);
    options.setRasterizeToPDF(false);
    redactor.save(options);
}
finally {
  redactor.close();
}

annotated.xlsx is the sample file used in this example. Click here to download it.

Binary file (XLSX, 12 KB)

Download full output