# Is there an event for when signatures get placed onto a PDF?

**URL:** <https://pdfjs.community/t/is-there-an-event-for-when-signatures-get-placed-onto-a-pdf/1080>\
**Category:** Technical Support\
**Created:** [October 20, 2021, 12:23am UTC](https://pdfjs.community/t/is-there-an-event-for-when-signatures-get-placed-onto-a-pdf/1080 "2021-10-20T00:23:10Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![psilva](https://avatars.discourse-cdn.com/v4/letter/p/d78d45/32.png) [@psilva](https://pdfjs.community/u/psilva)\
**Post date:** [October 20, 2021, 12:23am UTC](https://pdfjs.community/t/is-there-an-event-for-when-signatures-get-placed-onto-a-pdf/1080/1 "2021-10-20T00:23:10Z")

</div>

**Which product are you using?**  
PDF.js Express Plus

**PDF.js Express Version**  
8.1.0

**Detailed description of issue**  
I have a use-case where I need to know when a signature has been placed in a PDF (using a signature field, with the blue “Sign here” button). I thought this here was what I was looking for:

[https://pdfjs.express/api/Core.Tools.SignatureCreateTool.html#event:signatureSaved](https://pdfjs.express/api/Core.Tools.SignatureCreateTool.html#event:signatureSaved)

But I can’t get any of those 4 events to trigger when I test inserting a signature.

**Code snippet**  
Here is what I tried:

```javascript
sigTool = new Tools.SignatureCreateTool(instance.docViewer);
sigTool.addEventListener("signatureSaved", (annotation) => {
    debugger
    console.log(annotation);
});
sigTool.addEventListener("locationSelected", (annotation) => {
    debugger
    console.log(annotation);
});
sigTool.addEventListener("annotationAdded", (annotation) => {
    debugger
    console.log(annotation);
});

```

None of those are triggering. I get no JavaScript errors, so I’m pretty sure I’m using SignatureCreateTool correctly here, but the events never trigger.

What am I missing?

Thanks,

Lucas

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex031/uploads/pdfjscommunity/original/1X/ffbcd25c7d423db8d5acd5db201c272f4db306dd.png) [@system](https://pdfjs.community/u/system)\
**Post date:** [October 20, 2021, 12:23am UTC](https://pdfjs.community/t/is-there-an-event-for-when-signatures-get-placed-onto-a-pdf/1080/3 "2021-10-20T00:23:15Z")

</div>

**Hello, I’m Ron, an automated tech support bot 🤖**

While you wait for one of our customer support representatives to get back to you, please check out some of these documentation pages:

Guides:
- [Signatures with PDF.js Express - Get started](https://pdfjs.express/documentation/signature/overview#get-started)
- [API for Signing PDFs with PDF.js Express](https://pdfjs.express/documentation/signature/api)
- [Add signatures to PDFs](https://pdfjs.express/documentation/signature/signature-tool)

APIs:
- [Core.Tools.SignatureCreateTool - exportSignatures()](https://pdfjs.express/api/Core.Tools.SignatureCreateTool.html#exportSignatures__anchor)
- [UI.VerificationOptions](https://pdfjs.express/api/UI.VerificationOptions.html#__anchor)
- [Core - getDefaultBackendType()](https://pdfjs.express/api/Core.html#.getDefaultBackendType__anchor)

Forums:
- [Add signature fields to PDFs](https://pdfjs.community/t/add-signature-fields-to-pdfs/713/3)
- [Add Signature Fields](https://pdfjs.community/t/add-signature-fields/400/1)
- [Can i custom signatureModal in sigature field](https://pdfjs.community/t/can-i-custom-signaturemodal-in-sigature-field/834/2)

---

<div class="post-metadata">

**Author:** ![driley](https://avatars.discourse-cdn.com/v4/letter/d/13edae/32.png) [@driley](https://pdfjs.community/u/driley)\
**Post date:** [October 21, 2021, 8:23pm UTC](https://pdfjs.community/t/is-there-an-event-for-when-signatures-get-placed-onto-a-pdf/1080/4 "2021-10-21T20:23:18Z")

</div>

Hi psilva,

You are quite close, `sigTool` should be initiated like so:

```javascript
 const { Core } = instance;
 const { documentViewer } = Core; 
 const sigTool = documentViewer .getTool('AnnotationCreateSignature');

```

Cheers,  
Dustin

---

<div class="post-metadata">

**Author:** ![psilva](https://avatars.discourse-cdn.com/v4/letter/p/d78d45/32.png) [@psilva](https://pdfjs.community/u/psilva)\
**Post date:** [November 5, 2021, 2:27pm UTC](https://pdfjs.community/t/is-there-an-event-for-when-signatures-get-placed-onto-a-pdf/1080/5 "2021-11-05T14:27:47Z")

</div>

Dustin,

This worked, thanks for the help.

BTW I never got a reply to this ticket: [How to style a PDF form drop-down?](https://pdfjs.community/t/how-to-style-a-pdf-form-drop-down/1079)

Is this ticket posted? I’m not sure if I made a mistake creating it, since it got no views for 2 weeks.

Could you help me with what I ask in it?

Thanks,

Lucas
