Starting from version 22.11 it is possible to specify a user role for each user.
While working with the replies, you can attach a User object to any Reply. This user object often represents the author of the reply. From now you can also secify a role of the user. If the user role is “Viewer”, his replies will not be applied to the document. If the user role is “Editor”, his replies will be applied. This functionality allows you to control whether user can or cannot leave his comments on the document.
This sample shows how you can add a user role:
using(Annotatorannotator=newAnnotator("input.pdf-file")){AreaAnnotationarea=newAreaAnnotation{BackgroundColor=65535,Box=newRectangle(100,100,100,100),CreatedOn=DateTime.Now,Message="This is area annotation",Opacity=0.7,PageNumber=0,Replies=newList<Reply>{newReply{Comment="This comment will be applied",RepliedOn=DateTime.Now,User=newUser(1,"Reviewer",Role.Editor)},newReply{Comment="This comment will NOT be applied",RepliedOn=DateTime.Now,User=newUser(1,"Member",Role.Viewer)}}};annotator.Add(area);annotator.Save("result_export");}
More resources
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.