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

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

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:

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

Hello, I’m Ron, an automated tech support bot :robot:

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

Guides:APIs:Forums:

Hi psilva,

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

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

Cheers,
Dustin

1 Like

Dustin,

This worked, thanks for the help.

BTW I never got a reply to this ticket: How to style a PDF form drop-down?

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