Scandit.Signature

new Signature()

Creates a new instance of Signature

Examples
  • JavaScript
  • ES6
var signature = new Scandit.Signature();
const signature = new Scandit.Signature();

Methods

capture(): Promise

Captures the handwritten signature of the user

Returns:
Promise

Promise which is resolved to the local file url with mime type image/png.

Can return error with code:

Examples
  • JavaScript
  • ES6
var signature = new Scandit.Signature();
signature.capture().then(function(filePath) {
  console.log('Signature is captured, the image file is now saved at ' + filePath);
});
const signature = new Scandit.Signature();
signature.capture().then(function(filePath) {
  console.log(`Signature is captured, the image file is now saved at ${filePath}`);
});

close()

Closes the signature capture screen

Examples
  • JavaScript
  • ES6
var signature = new Scandit.Signature();
signature.capture().then(function(filePath) {
  console.log('Signature is captured, the image file is now saved at ' + filePath);
});

// assuming shouldCloseSignatureCapture is set based on some conditions that determine
// if the signature capture screen should be closed before the user is done capturing the signature
if (shouldCloseSignatureCapture) { signature.close(); }
let signature = new Scandit.Signature();
signature.capture().then(function(filePath) {
  console.log(`Signature is captured, the image file is now saved at ${filePath}`);
});

// assuming shouldCloseSignatureCapture is set based on some conditions that determine
// if the signature capture screen should be closed before the user is done capturing the signature
if (shouldCloseSignatureCapture) { signature.close(); }