var SignatureCreateTool = function(docViewer) {
Tools.FreeHandCreateTool.call(this, docViewer, Annotations.FreeHandAnnotation);
};
SignatureCreateTool.prototype = new Tools.FreeHandCreateTool();
SignatureCreateTool.prototype.complete = function() {
if (this.annotation) {
this.annotation.isSignature = true;
Tools.FreeHandCreateTool.prototype.complete.apply(this, arguments);
}
};
var oldFreeHandSerialize = Annotations.FreeHandAnnotation.prototype.serialize;
Annotations.FreeHandAnnotation.prototype.serialize = function() {
var el = oldFreeHandSerialize.apply(this, arguments);
if (this.isSignature) {
$(el).attr('signature', 'true');
}
return el;
};
$(document).on('documentLoaded', function() {
$("#toolModePicker").append('<li id="annot-button-signature" data-toolmode="AnnotationCreateSignature" title="Signature"><img src="custom_signature_image.png"/></li>');
readerControl.toolModeMap['AnnotationCreateSignature'] = SignatureCreateTool;
});