Update annotation replies

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 update annotation replies by accessing them using the Replies collection.

To update annotation replies, follow these steps:

  1. Instantiate the Annotator class. Specify the input document path or stream.
  2. Call the Get method of the Annotator class to get collection of the document annotations.
  3. Access a reply object in the Replies collection using its index (zero-based) and update its properties.
  4. Call the Update method of the Annotator class. Specify annotations.
  5. Call the Save method. Specify the output document path or stream and the SaveOptions class.

The following code snippet shows how to update reply by index: 

// NOTE: Input document already contain annotations with replies
using (Annotator annotator = new Annotator("result.pdf"))
{
	// Obtain annotations collection from document
	List<AnnotationBase> annotations = annotator.Get();
                
	// Update first annotation first reply
	annotations[0].Replies[0].Comment = "Updated reply";
                
	// Save changes
	annotator.Update(annotations);
	annotator.Save("result.pdf");
}

On this page