Hello there, I came across an opensource tool that is used to get a digital signature on the web using javascript. It is called signature_pad.
With 383k+ weekly downloads, I found signature_pad library is easy to install and use. It also has over 9.3k+ stars on Github making it a popular choice.
const canvas = document.querySelector("canvas");const signaturePad = new SignaturePad(canvas);// Returns signature image as data URL (see https://mdn.io/todataurl for the list of possible parameters)signaturePad.toDataURL(); // save image as PNGsignaturePad.fromDataURL("data:image/png;base64,iVBORw0K...");
Please note that you can check the official signature_pad’s Readme.md for further information. I have only included the code snippet that I dominantly used.
Although, I have had some issues around setting canvas height and width without breaking the signature feature. I have worked my way around using this https://github.com/szimek/signature_pad/issues/185
There are popular tools like PandaDoc, Docusign that are paid. If you are looking for an open source tool to help you with capturing a digital signature, I would recommend signature_pad
Hey, my name is Ramu Narasinga. I study large open-source projects and create content about their codebase architecture and best practices, sharing it through articles, videos.