Handle signature selection events in JavaScript PDF Viewer
24 Jun 20261 minute to read
The PDF Viewer exposes events for monitoring the selection state of handwritten signature annotations: signatureSelect and signatureUnselect. These events enable applications to respond when a signature annotation is selected or cleared—for example, updating the UI, enabling contextual actions, or recording metadata.
signatureSelect
The signatureSelect event fires when a handwritten signature annotation is selected. Event arguments include details about the selected annotation and its page. Use this event to perform actions such as showing a properties panel or enabling signature-specific controls.
signatureUnselect
The signatureUnselect event fires when a handwritten signature annotation is unselected. Handle this event to perform cleanup tasks, hide contextual UI, or update application state.
The following snippet shows how to subscribe to signatureSelect and signatureUnselect events in the PDF Viewer component.
pdfviewer.signatureSelect = (args: any) => {
console.log('Signature selected:', args);
};
pdfviewer.signatureUnselect = (args: any) => {
console.log('Signature selected:', args);
};These events enable robust management of handwritten signature state, supporting interactive and dynamic user experiences.