Quan Chu
unread,May 4, 2018, 12:59:08 PM5/4/18Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Sign in to report message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to PDFTron WebViewer
By default, the subject field will be the type of the annotation, such as "Line" or "Highlight" etc
How can I modify this property? I've tried to changed the annotation object directly from the array of annotations but on the right hand Note Panel, the subject of the annotations listed in there won't be affected.
So I'm looking for a way to either
1. updating the format of the subject field whenever an annotation is created
or
2. updating the DOM elements to reflect the changes I made on the annotation object on annotationChanged event
annotationManager.on('annotationChanged', function (e, annotations, action) {
if (!e.imported) {
var privateCheck = sessionStorage.getItem('private');
if (privateCheck !== 'true' && action === 'add') {
for (var i = 0; i < annotations.length; i++) {
annotations[i].Subject = "Private-" + annotations[i].Subject;
}
}
var xfdfString = annotationManager.getAnnotCommand();
var postAnnotationRequest = {
type: 'postAnnotationRequest',
docID: docid,
xfdfData: xfdfString,
docSource: docsource
};
sendMessage(postAnnotationRequest);
}
});