手写签名
手写签名
在WEB端直接进行手写签名操作,此功能需要插入存在证书的用户密钥盘或是从服务器中获取
调用示例
$(‘.testHW’).click(
function(){
var signatureCreator = Signature.create();
var that = this;
signatureCreator.handWriteDlg({
image_height: "6.7",
image_width: "5",
onBegin: function() {
console.log(‘onbegin’);
},
onEnd: function() {
console.log(‘onEnd’);
}
}, function(param){
//alert(param.imageData);
signatureCreator.runHW(param, {
protectedItems:[ ‘item1’, ‘item2’, ‘item3’],//设置定位页面DOM的id,自动查找ID,自动获取保护DOM的kg-desc属性作为保护项描述,value属性为保护数据。不设置,表示不保护数据,签章永远有效。
position: $(that).attr(‘pos’),//设置盖章定位dom的ID,必须设置
okCall: function(fn) {//点击确定后的回调方法,this为签章对象 ,签章数据撤销时,将回调此方法,需要实现签章数据持久化(保存数据到后台数据库),保存成功后必须回调fn(true/false)渲染签章到页面上
console.log("盖章ID:"+this.getSignatureid());
console.log("盖章数据:"+this.getSignatureData());
fn(true);
},
cancelCall : function() {//点击取消后的回调方法
console.log("取消!")
}
});
});
}
);