WebViewer Version: 8.2.0
Do you have an issue with a specific file(s)? No
Can you reproduce using one of our samples or online demos? Yes
Are you using the WebViewer server? No
Does the issue only happen on certain browsers? No
Is your issue related to a front-end framework? No
Is your issue related to annotations? Yes
Please give a brief summary of your issue:
We could create customized stamps in StampCreateTool, is there any events for stamp saved or stamp deleted events similar to signature?
Please describe your issue and provide steps to reproduce it:
- Click Insert tab
- Select Rubber Stamp
- Click Create New Stamp and customize the rubber stamp
- Click Create
- Add the stamp to the document
- Delete the customized stamp
I read through the API and found that there is only annotationAdded event which is fired when an annotation is added to the document, however there is no events for deleting customized stamps.
Please provide a link to a minimal sample where the issue is reproducible:
StampCreateTool is only responsible for creating the annotation, but not deleting it. The delete event is triggered on the
AnnotationManager instead: PDFTron WebViewer Class: AnnotationManager.
Let me know if this helps!
So there’s no events fired when I click the delete buttons in the red rectangle area in the attached screenshot?
Thanks for the clarification!
There actually is an undocumented event that you could leverage. It does not indicate the type of action being taken, but it does provide a list of custom rubber stamps you have created. The event is the
stampsUpdated event on the
instance.Core.documentViewer.getToolModeMap().AnnotationCreateRubberStamp.addEventListener('stampsUpdated', customStamps => console.log(customStamps));
You can do a comparison of a before and after to determine if a stamp was removed. The
getCustomStamps API may help.