Add point annotation

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

Point annotation sticks comments to any point in a document as shown in the picture below:

You can specify the following properties of the PointAnnotation class:

  • Box defines the annotation position on the page

To add a point annotation, follow these steps:

  1. Instantiate the Annotator class. Specify the input document path or stream.
  2. Instantiate the PointAnnotation class. Specify the appropriate properties (position, page number, etc).
  3. Call the Add method. Specify the PointAnnotation class.
  4. Call the Save method. Specify the output document path or stream. 

The following code snippet shows how to add PointAnnotation to the document:

//Add point annotation to the document from local disk
using (Annotator annotator = new Annotator("input.pdf"))
{
	PointAnnotation point = new PointAnnotation
    {
    	Box = new Rectangle(100, 100, 0, 0),
        CreatedOn = DateTime.Now,
        Message = "This is point annotation",
        PageNumber = 0,
        Replies = new List<Reply>
        {
        	new Reply
            {
            	Comment = "First comment",
                RepliedOn = DateTime.Now
            },
            new Reply
            {
             	Comment = "Second comment",
                RepliedOn = DateTime.Now
            }
        }
    };
    annotator.Add(point);
    annotator.Save("result.pdf"));
} 

On this page