Knowing when signature tool is active

17 views
Skip to first unread message

Matt Parizeau

unread,
Sep 23, 2016, 8:28:59 PM9/23/16
to PDFTron WebViewer
Q:

We would like to have different behavior when clicking on signature fields in the PDF depending on if the signature tool in WebViewer is active or not. How can we tell when this tool is active?

A:

You could use the following function to check:
function isSignatureActive(){
 
return readerControl.getToolMode() === 'AnnotationCreateSignature';
}

Or if you want to know when the signature tool is switched to you could use the following code:

$(document).on('viewerLoaded', function() {
  readerControl
.docViewer.on('toolModeUpdated', function(e, newToolMode, oldToolMode) {
    console
.log(newToolMode instanceof Tools.SignatureCreateTool);
 
});
});

Reply all
Reply to author
Forward
0 new messages