HTML5 canvas based smooth signature drawing
open sourceMITself-hostablefree
Signature Pad is a JavaScript library for drawing smooth signatures on an HTML canvas with a mouse, finger or stylus. It uses variable-width Bézier curve interpolation, after Square's "Smoother Signatures" post, so strokes look like ink rather than jagged lines. A signature exports as a PNG, JPEG or SVG data URL or an SVG string, and as point data that can be stored and drawn again. It has no dependencies, works in modern desktop and mobile browsers, and ships as UMD and ES modules.
Problems it solves
- let people sign with their finger on a phone in my web form
- capture a handwritten signature and save it as an image
- signatures drawn on a canvas look jagged and thin
- export a drawn signature as SVG so it stays sharp in a PDF
- add undo and clear buttons to a signature box
- store a signature as points so I can redraw it later at any size
- a lightweight signature field without pulling in a whole e-signature product
- the signature canvas is blurry on high-DPI screens
Features
- variable-width Bézier smoothing
- PNG, JPEG and SVG export
- toSVG string output
- point data export and import
- pen colour, width and background options
- mouse, touch and pen input
- no dependencies
- UMD and ES module builds
