Product: Webviewer
Product Version: 10.12.0
Please give a brief summary of your issue:
How to capture clear signature event in wevbiewer?
Please describe your issue and provide steps to reproduce it:
I want to capture Clear Signature Event of Signature Field. I have used below code.
Please provide a link to a minimal sample where the issue is reproducible:
const signatureTool = documentViewer.getTool('AnnotationCreateSignature');
signatureTool.addEventListener('signatureDeleted', (annotation, index) => {
console.log(annotation, index)
});
1 Like
Hello, Iâm AiRon, an automated tech support bot 
While you wait for one of our customer support representatives, I can help you with your question.
Capturing the clear signature event in WebViewer involves using the appropriate event listeners for signature fields. It seems like youâre trying to use an event listener for when a signature is deleted from a signature field.
Some things you can try:
- Ensure that youâre using the correct event name. The event you are interested in is likely related to clearing a signature rather than deleting an annotation.
- Check if there is a specific API or event that handles the clearing of a signature in the version of WebViewer youâre using.
- Verify that the tool or object youâre attaching the event listener to is properly initialized and active in the context where youâre trying to use it.
- Look into using the
clearSignature
API, which can help in managing signature states and might provide callbacks or events for when a signature is cleared.
Here are some resources that might help you:Hopefully, this helps you solve your problem while you wait for a human to get back to you.
1 Like
Hello @jasmin.malani,
Thank you for posting on our forum.
The signatureDeleted event is meant to capture when a signature is removed from the âlist of optionsâ on the Signature Create Tool. We have different options for capturing the moment a signature is deleted from the document, depending on if you are signing with annotation or with appearance. (See here for more information on which signing type you may be using)
If signing with annotation, you can use the annotationChanged event and check to make sure the action is âdeleteâ and the annotation is a Signature. You can find the API doc for this event here: https://sdk.apryse.com/api/web/Core.AnnotationManager.html#event:annotationChanged.
If you are signing with appearance, you can use the updateElement() API to override the onClick function for the âClear Signatureâ button and run the desired code there. If using this method, you can use the clearSignature() function in order to remove the annotation after your code.
You can find the relevant API docs for this option here:
Let us know if you need further clarification!
Best Regards,
Jacob Romano Carlsen
Web Development Support Engineer
Apryse Software Inc.
1 Like