How do parse all annotations when they are loaded?

11 views
Skip to first unread message

Ryan - PDFNet Developer

unread,
Sep 22, 2017, 8:13:25 PM9/22/17
to PDFTron WebViewer
Question:

I want to make some transformations on some annotations when they are first loaded, before they are visible to the user.

Answer:

You would add the following code to your config.js file.

(function() {
    $
(document).bind("documentLoaded", function(event) {
        readerControl
.docViewer.getAnnotationManager().on('annotationChanged', function(e, annotations) {
         
if (e.imported) {
           
// annotations from the source document or from server
            annotations
.forEach(function(annot) {
                console
.log(annot);
           
});
       
}});
   
});
})();




Reply all
Reply to author
Forward
0 new messages