
17 www.epadlink.com
Integration Guide (ePad-vision SDK for Chrome & Firefox)
The web page uses the following code to raise the custom DOM event and start signature capture.
8.5 – ePad-vision device access
ePad-vision Firefox native libraries JsonDeserialize function is invoked for accessing different features
of the SDK. The same function should be invoked with different input messages for accessing various
features like OpenConnection, CloseConnection, CreateScreen (without Signature capture),
CreateScreen (with Signature capture), PinPad screen and Refresh screen.
The function takes the input data as a JSON message. Though regular strings and other regular data
types can be used, JSON format is used to make the Firefox implementation consistent with Chrome
APIs.
The format of the JSON message is
{text: value1, text1: value2}
where ‘text’ and ‘text1’ are the names of the JSON parameters.
The value1 and value2 entries are the values in JSON format. These will be processed by the library
and interact with the ePad-vision device for signature capture and screen creation.
var cmdOpenConn = {"command": 1 , "inking": false , "inkRegionx": 0 , "inkRegiony": 0, "inkRegionWidth": 0 ,
"inkRegionHeight":0, "widgetLayout": ''};
var cmdOpenConnObj=JSON.stringify(cmdOpenConn);
var retval =send(cmdOpenConnObj);
The return value from the JsonDeserialize function is again a JSON message which is the output
message described in subsequent ePad-vision SDK API section. In case of Chrome the output
message is sent as a callback to the registered function asynchronously.
// Create a dummy HTML Element
var element = document.createElement("JSONParseElement");
//Append the element to the document object
document.documentElement.appendChild(element);
function TopazMozillaSignStart()
{
var evt = document.createEvent("Events");
evt.initEvent("TopazMozillaSignStartEvent", true, false);
element.dispatchEvent(evt);
}
// Raise the custom event when user clicks on button e.g. sign button/link
document.getElementById('sign').addEventListener('click', TopazMozillaSignStart);
Comentarios a estos manuales