Cordova Signature View plugin
This works best with an "active" pen, to get the most detailed output. It captures normal "touch" events, so you could use it with a pressure pen or fingers, but the results won't be as accurate.
In principle, you could use the plugin as a generic drawing/sketch capturing system, but it provides no drawing "tools" of any kind.
This extension is a little strange in that it installs a file called
www/js/signature-view.js directly into your application. You can load
this and it will provide the AMD module
you're not using an AMD loader, it will define a global SignatureView
variable (a property on "window"). It provides only one method, with
the following signature (no pun intended):
success argument is a callback function accepting one argument,
which is either null (in case the user canceled the dialog) or an
object containing the raw binary image data.
error argument is a callback function accepting one argument,
which is a string containing an error message indicating what went
title argument is an optional string which indicates what the
dialog should show as a heading.
htmlPage argument is also an optional string which supplies a
full HTML page which will be presented in a webview above the
signature pad area. This allows you to place salient parts about the
agreement just above the signature, which should help ensure that the
user knows what they're signing. The base
www directory is
configured as its base URI, so you can use assets from your
Beware when converting the image data to a data URI: some mobile
browsers (and IE) have length limitations on data URIs. It's better
to use the image data with the canvas/2dcontext
or something equivalent.
Here's a minimal working example. It assumes there's a CANVAS element
in your HTML document which has an id of