addObjectSignature
Puts the pad into signature capture mode and specifies the signature object in which a captured signature is saved. Only one signature object can be added to the current control list.
wizCtl.addObjectSignature(id, sigSDK, sigObj, options)
| Parameter | Description |
|---|---|
| id | String that identifies the object. |
| sigSDK | The initialized SDK module. |
| sigObj | A SigObj with a valid licence. The captured signature is stored in this object. |
| options | Object with the following fields: (Optional)
|
| Return values |
|---|
| The added signature object. Throws an exception if an error occurs. |
The returned object has the following property:
| Property | Description |
|---|---|
onSignatureCaptured | Function called when the signature has been captured and accepted. |
Add text objects with the ids who and why to store the signatory's name and the reason for signing in the signature.
See addObjectText.
The following example captures a signature, bound to a document hash:
const signatureOpts = {
integrityKey: sigSDK.KeyType.SHA512,
documentHash: documentHash
};
const signComponent = wizCtl.addObjectSignature("Sig", sigSDK, sigObj, signatureOpts);
signComponent.onSignatureCaptured = async function() {
// The signature is now stored in sigObj
return true;
}
wizCtl.addObjectButton("clear", "centre", "bottom", "Clear", 100);
wizCtl.addObjectButton("ok", "right", "bottom", "OK", 100);
await wizCtl.display(false);