Remove annotation from document

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.Annotation 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-annotation -- dnx GroupDocs.Annotation.Mcp --yes
Folders, licensing and more →

On this page

GroupDocs.Annotation allows you to remove all previously added annotations. To do this, follow these steps:

  1. Instantiate the Annotator class. Specify the input document path or stream.
  2. Instantiate the SaveOptions class. Set AnnotationTypes = AnnotationType.None.
  3. Call the save() method. Specify the output document path or stream.

The following code snippet shows how to remove annotation using its index:

// This example demonstrates how to remove annotations from document.

// Create an instance of Annotator class
Annotator annotator = new Annotator("inputPath");

SaveOptions saveOptions = new SaveOptions();
saveOptions.setAnnotationTypes(AnnotationType.None);

// Save result to file
annotator.save("outputPath", saveOptions);

On this page