Web Signature Capture control in asp.net


Today I want to introduce an interesting and an important article for Third party control(licensed software)for to sign the online documents. That control is none other than web signature capture control.This web signature capture control need a mouse which already exists in your computer and this control will provide a mouse pad like image.Just we need to sign with the mouse on the mouse pad image and generate an image for your sign.How to work with this control i want to discuss in this article.

In General Digital signatures are of high cost. Their software and hardware integration is very complicated.And we need a web signature which eliminates all this factors.This web signature capture control software is very easy to use and the most important thing is it comes with very less cost.No hardware is needed to install it in your computer.

Why we need this Web signature capture control:


Today internet becomes the most important and effective way used for transmitting/transferring the data.With using of this technology we should take an advantage to Save our Environment no paper forms to fill out and send, feel good about your yourself, your business. Conduct business environmentally friendly and brag about it. Allow your website users to sign documents online using the mouse as a pen! Now legal documents and agreements can be displayed online and signed instantly using the mouse as a pen. Web Signature Capture eliminates the traditional hassle of downloading, printing, signing, and faxing. Making the signup process easy avoids lost sales.

After Buying this licensed software its very easy to integrate in your asp.net.The Software includes one Web user control(.ascx) (which is written vb language) associated with it and a Java script file with that one product documentation pdf file.
The Product documentation contains description of all the properties that are associated with the control.Just we need to assign the properties as per our requirement.

This code will give you an image like mouse pad which we are going to sign on this mouse pad.


id="Signature1"
PenColor="Black"
PenWidth="2" BackColor="White"
SignatureFileFormat="Png"
SignWidth="300" SignHeight="100"
Savepath="~/Signatures/"
SignatureCodePath="~/SignatureControl/"
Runat="server">


I will illustrate the above snippet of the code.

Pen Color ="Black" : when you are signing the document the font color will be in black.we can change the color of the pen color with this attribute

Width : You can set the width and height of this mouse-pad .

SavePath:when a User signs on this Mousepad than we can save the sign in particular location of your computer.

SignatureCodePath :Each signature codepath will be assigned to save on particular location.

You can save your signature in any image format like jpeg/png/bmp/gif e.t.c
If you have not signed properly you will have a facility to resign the document with this control.You can use this signature control as many times in your form.But we need to enhance the snippet of the code that is given by the software vendor.
 
<script language="javascript" type="text/javascript">
// This is the method that is directly called, this will save signature
// and then call server code to do further processing. You can change
// the delay of 5 seconds as per your needs
function DirectSave() {

document.getElementById('HiddenField1').value = "True";
// delay of 5 seconds, 5000 milisecons, change as per requirement

do { curDate = new Date(); }
while (curDate - date < 100);
alert('Signature1 Saved');
SaveSignature('SignObj_ctlMySignature');
var date = new Date();
var curDate = null;
// delay of 5 seconds, 5000 milisecons, change as per requirement
do { curDate = new Date(); }
while (curDate - date < 100);
alert('Signature2 Saved');
SaveSignature('SignObj_Signature1');
var date = new Date();
var curDate = null;

// delay of 5 seconds, 5000 milisecons, change as per requirement
do { curDate = new Date(); }
while (curDate - date < 100);
alert('Signature3 Saved');
//setTimeout(alert('Signature3 Saved'), 1000)
SaveSignature('SignObj_Signature2');
var date = new Date();
var curDate = null;

// delay of 5 seconds, 5000 milisecons, change as per requirement
do { curDate = new Date(); }
while (curDate - date < 100);
alert('Signature4 Saved');
//setTimeout(alert('Signature4 Saved'), 1000)
do { curDate = new Date(); }
while (curDate - date < 100);
SaveSignature('SignObj_Signature3');
alert('Click ok to Submit the Data');
return true;
}



This JavaScript calls save signature method that exists the Usercontrol page i.e(.ascx)given by the software vendor.After every sign it will pause for 5 seconds that is the time your signature is going to save in your computer.and you are passing an argument of the webcaptureSignatureusercontrol id.you can use more than one instance webcapturesignaturecontrol id in your form and generate a image for your sign.

Now i will illustrate how to work with more than one web signature control in your form.I will write only programmer logic.Entire software code will be given by the Software Vendor

Private Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs)
If Not Page.IsPostBack Then
Try
tmp1 = Request.Form(0)
tmp2 = Request.Form(1)
pwidth = Request.Form(2)
pcolor = Request.Form(3)
bgcolor = Request.Form(4)

'Session.Abandon()
If Session("flag") = "false" Then
Session("signaturefile") = ""
Session("signaturefile1") = ""
Session("signaturefile2") = ""
Session("signaturefile3") = ""
Session("flag") = "true"
End If
If Session("signaturefile") = "" Then
sSavePath = Convert.ToString(Request.Form(8)).Replace("_", "/")
signaturefile = "ctlMySignature_" & System.Guid.NewGuid.ToString() & ".png" 'Request.Form(5)
Session("signaturefile") = signaturefile
outPath = (Server.MapPath(sSavePath) & "") + signaturefile
Session("COUNT") = 0
// Thread.Sleep(3000)
End If
If Session("signaturefile1") = "" And Session("COUNT") = 1 Then
sSavePath = Convert.ToString(Request.Form(8)).Replace("_", "/")
signaturefile1 = "ctlMySignature_" & System.Guid.NewGuid.ToString() & ".png" 'Request.Form(5)
Session("signaturefile1") = signaturefile1
outPath = (Server.MapPath(sSavePath) & "") + signaturefile1

//Thread.Sleep(5000)
End If
If Session("signaturefile2") = "" And Session("COUNT") = 2 Then
sSavePath = Convert.ToString(Request.Form(8)).Replace("_", "/")
signaturefile2 = "ctlMySignature_" & System.Guid.NewGuid.ToString() & ".png" 'Request.Form(5)
Session("signaturefile2") = signaturefile2
outPath = (Server.MapPath(sSavePath) & "") + signaturefile2
//Thread.Sleep(5000)
End If
If Session("signaturefile3") = "" And Session("COUNT") = 3 Then
sSavePath = Convert.ToString(Request.Form(8)).Replace("_", "/")
signaturefile3 = "ctlMySignature_" & System.Guid.NewGuid.ToString() & ".png" 'Request.Form(5)
Session("signaturefile3") = signaturefile3
outPath = (Server.MapPath(sSavePath) & "") + signaturefile3
//Thread.Sleep(5000)
End If

cWidth = Request.Form(6)
cHeight = Request.Form(7)

Catch ex As Exception
Response.Redirect(Page.ResolveUrl("~/"))
End Try
count = Session("COUNT")
Session("COUNT") = count + 1
GenerateImage()
End If
End Sub


we need to create Guid values and assign to each sign of the image to store in the computer.
          
strfilename1 = "/Signatures/" & Session("signaturefile")
strfilename2 = "/Signatures/" & Session("signaturefile1")
strfilename3 = "/Signatures/" & Session("signaturefile2")
strfilename4 = "/Signatures/" & Session("signaturefile3")

the path of the image where this sign has stored.In the Control we can set the property of the path.The Web signature capture control will also provide to save the sign in Bytes format.with the help of this method.

Dim bytesram() As Byte = ctlMySignature.Request.BinaryRead(100)


This websignature control works in all browsers with no activex control or dlls are not needed.Simple and easy to use.

Now Lets Join our hands and oath to keep our environment Greenery.


save trees ... Be paperless


Article by srirama
A Good advice from parent to a Child , Master to a Student , Scholar to an Ignorant is like a doctor prescribed pill it is bitter to take but when they take it will do all good for them --- Bhushan

Follow srirama or read 73 articles authored by srirama

Comments

Author: Kuldev Bhasin03 Aug 2014 Member Level: Bronze   Points : 0

Which is the control being used and from where can we get the control ?

Author: Kuldev Bhasin03 Aug 2014 Member Level: Bronze   Points : 0

What is the control being used and how do we get the control ?

Author: srirama03 Aug 2014 Member Level: Gold   Points : 0

This is a Thirdparty control we need to buy it from the below url....http://www.realsignature.com/



  • Do not include your name, "with regards" etc in the comment. Write detailed comment, relevant to the topic.
  • No HTML formatting and links to other web sites are allowed.
  • This is a strictly moderated site. Absolutely no spam allowed.
  • Name:
    Email: