Automatically open note editing in mobile viewer

29 views
Skip to first unread message

Matt Parizeau

unread,
Jan 18, 2017, 1:33:38 PM1/18/17
to pdfnet-w...@googlegroups.com
Q:

When you want to create a note first you have to add it to the page and then press the "Note" button before you're able to add text. Is it possible to immediately enter text after adding the annotation?

A:

Yes, you can add the following code to a config file:
$(document).on('viewerLoaded', function() {
 
var annotation = null;

  $
(document).on('tap', function(e) {
   
if (annotation) {
      readerControl
.$annotEditPopup.find('#editNoteButton').trigger('click');
      $
('[data-id=' + annotation.Id + ']').find('textbox').trigger(e);
      annotation
= null;
   
}
 
});

 
var stickyNoteTool = readerControl.toolModeMap[window.PDFTron.WebViewer.ToolMode.AnnotationCreateSticky];
  stickyNoteTool
.on('annotationAdded', function(e, stickyAnnotation) {
    annotation
= stickyAnnotation;
 
});
});

Reply all
Reply to author
Forward
0 new messages