Preload signature images from server.

214 views
Skip to first unread message

Syed Ali

unread,
Feb 27, 2020, 6:07:40 PM2/27/20
to PDFTron WebViewer
Hi All,

I am pretty new to PDFTron. Currently I am checking WebViewer 6.1.0 for our requirement.
I would need to preload signature images of current user  from server to Signature tool upon loading the WebViewer.
Could you please help me accomplish this? Is there any api available for this?
Any help on this would be greatly appreciated.


Thanks,

Syed

Andy Huang

unread,
Mar 2, 2020, 2:20:09 PM3/2/20
to PDFTron WebViewer
Hi Syed,

It is possible to load the images into the signature tool!

You will have to first fetch the image data and convert it to a base64 string. Next, you should increase the max signature count in WebViewer if you have more than two signatures: https://www.pdftron.com/api/web/WebViewerInstance.html#setMaxSignaturesCount__anchor. You can then get the signature tool from the document viewer using docViewer.getTool('AnnotationCreateSignature') to start adding signatures.

There are two methods to adding signatures as there are two different APIs for this. They are both found on the SignatureCreateTool returned by getTool. The first and recommended option is to use importSignatures which takes an array of strings (base64) or an array of array points: https://www.pdftron.com/api/web/Tools.SignatureCreateTool.html#importSignatures__anchor. I recommend this option as it is more direct. The second option is to create the SignatureAnnotation/FreeHandAnnotation manually and use saveSignatures method to add them.

Let me know if this helps!

Andy Huang
Software Developer
PDFTron Systems Inc.

Syed Ali

unread,
Mar 4, 2020, 12:41:13 PM3/4/20
to PDFTron WebViewer on behalf of Andy Huang
Hi Andy,

I will try this options and let you know.

Thanks,
 Syed


--
You received this message because you are subscribed to the Google Groups "PDFTron WebViewer" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pdfnet-webview...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pdfnet-webviewer/277a3bbd-377a-4be9-b0f4-d52fee1a27d2%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages