Hi Sriraman,
Refer the below sample to restrict users to edit and
delete other user's comments and also you can reply to their comments.
Code Snippet:
public documentLoad(args) {
var viewer = (<any>document.getElementById('pdfViewer')).ej2_instances[0];
viewer.annotationSettings.author = 'Syncfusion1';
}
public ajaxRequestSuccess(args) {
if (args.action === 'RenderAnnotationComments') {
setTimeout(() => {
console.log(args);
var viewer = (<any>document.getElementById('pdfViewer'))
.ej2_instances[0];
if (viewer.annotationSettings.author !== 'Syncfusion') {
for (var i = 0; i < viewer.annotationCollection.length; i++) {
viewer.annotationCollection[i].isCommentLock = true;
viewer.annotation.editAnnotation(viewer.annotationCollection[i]);
}
}
}, 500);
}
}
|
Sample: https://stackblitz.com/edit/angular-ddg23x-cyzatv?file=main.ts,app.component.html,app.component.ts
Note: In the given sample, We are setting the author name
in the documentLoaded event and then we are locking the comments if the author
name is not equal to "Syncfusion".
Regards,
CCM
Karthik