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);
});
});