GroupDocs.Annotation provides an ability for several users to collaborate over document via annotations and annotation replies. Adding reply to an annotation via code is as easy as specifying reply content and related user object.
Here are the steps to add annotation replies:
Instantiate Annotator object with input document path or stream;
Instantiate annotation object of desired type. Available annotation types are listed here;
Assign User object to Reply. User property (or by default will be “Guest”);
Assign Reply object(s) to Replies collection of an annotation object created at previous steps;
Call Add method of Annotator object and pass annotation to it;
Call Save method with resultant document path or stream;
The following code demonstrates how to add replies to annotation:
using(Annotatorannotator=newAnnotator("input.pdf")){Useruser1=newUser{Id=1,Name="Tom",Email="somemail@mail.com"};Useruser2=newUser{Id=2,Name="Jack",Email="somebody@mail.com"};AreaAnnotationarea=newAreaAnnotation{Box=newRectangle(100,100,100,100),CreatedOn=DateTime.Now,Message="This is an area annotation",PageNumber=0,Replies=newList<Reply>{newReply{Id=1,Comment="First comment",RepliedOn=DateTime.Now,User=user1},newReply{Id=2,Comment="Second comment",RepliedOn=DateTime.Now,User=user2,}}};annotator.Add(area);annotator.Save("result.pdf");}
More resources
Advanced Usage Topics
To learn more about document annotating features, please refer to the advanced usage section.
GitHub Examples
You may easily run the code above and see the feature in action in our GitHub examples:
Along with full-featured .NET library we provide simple but powerful free Apps.
You are welcome to annotate your PDF, DOC or DOCX, XLS or XLSX, PPT or PPTX, PNG and other documents with free to use online GroupDocs Annotation App.
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.