Skip to main content

wizard.js

wizard.js

Within wizard/wizard.js, the function onOk() in version 1 features the following if statement:

	async #onOk() {
if (this.mPadMode == WizCtl.#PadMode.PadSigning) {
if (this.#hasPenData()) {
await this.#generateSignature();
this.#onCancel();

let signObject;
for (var i=this.objects.length-1; i>-1; i--) {
if (this.objects[i].type == WizCtl.ObjectType.ObjectSignature) {
signObject = this.objects[i];
}
}
if (signObject && signObject.onSignatureCaptured) {
return signObject.onSignatureCaptured(this.mSigObj);
}

The function #generateSignature also requires the following adjustments:

On line 2648:

            var point = {
'x': this.mPenData[index].x,
'y': this.mPenData[index].y,
'p': this.mPenData[index].pressure,
't': this.mPenData[index].timeCount,
'azimuth': 0, // STU has no azimuth
'altitude': 0, // STU has no altitude
'twist': 0, // STU has no twist
'is_down': this.mPenData[index].sw,
'stroke_id': currentStrokeID
};

currentStroke.push_back(point);
}

//Create capture area character
var device = {
'device_max_X': this.mCapability.tabletMaxX,
'device_max_Y': this.mCapability.tabletMaxY,
'device_max_P': this.mCapability.tabletMaxPressure,
'device_pixels_per_m_x': 100000,
'device_pixels_per_m_y': 100000,
'device_origin_X': 0,
'device_origin_Y': 1,
'has_tilt': false,
'has_twist': false
}

Line 2688:

        var digitizerInfo = "STU;'"+this.mInformation.modelName+"';"+this.mInformation.firmwareMajorVersion+"."+((parseInt(this.mInformation.firmwareMinorVersion) >> 4) & 0x0f)+"."+(parseInt(this.mInformation.firmwareMinorVersion) & 0x0f)+";"+uid2;
var nicInfo = "";
var timeResolution = 1000;
var who = this.who;
var why = this.why;
var where = "";

Finally, line 2712:

        await this.mSigObj.generateSignature(this.who?this.who:"", this.why?this.why:"", where, integrityKey, documentHash, strokeVector, device, digitizerInfo, nicInfo, timeResolution);

if (deleteHash) {
documentHash.delete();
}
strokeVector.delete();
currentStroke.delete();