- Home
- Forum
- JavaScript - EJ 2
- How to tell if an ink annotation has been drawn on top of the signature field
How to tell if an ink annotation has been drawn on top of the signature field
You helped me with this issue: https://www.syncfusion.com/forums/198238/property-to-tell-me-that-a-signature-field-has-been-signed
The solution from item above works fine until you save the document and reload it
My new issue: In my application you can save and finish later. Once I load the PDF into the PDF viewer, I need to check if singature fields have been signed (just ink, not digitally) and enable/diable buttons accordingly.
In my previous issue, you stated "When a signature field is added through the PDF Viewer, the component captures the user’s input as an ink annotation drawn on top of the signature field."
Is there a property or way to know if there is ink on the signature field when the document is loaded?
Hi Jill Griggs,
Thank you for your patience. You can verify whether the signature field is already signed when loading the PDF document by using the formFieldCollections API and checking the value of the signature fields in the documentLoad event.
We have attached a working sample for your reference. Please review it and let us know whether it meets your requirements or if you have any questions.
Code snippet:
viewer.documentLoad = function (args) {
const formFields = viewer.formFieldCollections || [];
// Get all SignatureField types
const signatureFields = formFields.filter(
(field) => field.type === 'SignatureField'
);
// Loop and check value
signatureFields.forEach((field) => {
if (field.value && field.value.trim() !== '') {
console.log('Filled Signature Field name:', field.name);
}
});
};
Sample project for checking whether the sign is added in Signature field
Regards,
Venkada Subramanian D
Attachment: Server_Project_13c993e1_f2c87b21.zip
That solved my problem, thank you!
I do have one followup question. When a user clicks the signature and deletes it, is there a signature removed event or something like that so I can disable a button if user removes a signature?
Thank you for all of your help! I really appreciate it!
Hi Jill Griggs,
Thank you for your feedback. Yes, the Syncfusion JavaScript PDF Viewer also provides a removeSignature event, which is triggered when a signature is removed from a signature field.
We have attached a sample project for your reference. Please review it and let us know whether it meets your requirements. If you have any questions or need further clarification, feel free to reach out.
Code snippet:
viewer.removeSignature = function (args) {
console.log('Signature is deleted from Field!', args);
if (!args || !args.id) {
console.warn('Signature args or args.id is missing');
return;
}
// 1. Get original field id (before "_")
const fieldId = args.id.split('_')[0];
// 2. Loop through form field collections
const formFields = viewer.formFieldCollections || [];
const signatureField = formFields.find(
(field) => field.id === fieldId && field.type === 'SignatureField'
);
// 3. Log signature name
if (signatureField) {
alert(`Signature is deleted from Field! ${signatureField.name}`);
} else {
alert('No matching signature field found for id:', fieldId);
}
};
Sample project with removeSignature event
Regards,
Venkada Subramanian D
- 3 Replies
- 2 Participants
- Marked answer
-
JG Jill Griggs
- May 28, 2026 05:38 PM UTC
- Jun 4, 2026 10:42 AM UTC