Hello! I created an electronic sign-in sheet with InfoPath and an e-sig lcd tablet. Using jscript code provided by the e-sig tablet vendor I was able to create a jpg of the signature and link it to the document. The problem I'm having now, because the file name is hardcoded into the control (C:\SigImage.jpg), is that the most current SigImage.jpg is being referenced to all the signed documents.
Is there a way in jscript to generate an unique ID using something similar to a now() to give each jpg it's own unique file name to link back to the form? Here is the code behind my button:
function CTRL1_5::OnClick(eventObj)
{
//This button initiates the tablet for signing
sigObj.InitSigPlus();
sigObj.OpaqueMode=true;
sigObj.TabletState=1;
}
function CTRL2_5::OnClick(eventObj)
{
//This button is pressed after the tablet is signed, it attaches the image of the jpg to the InfoPath document
sigObj.TabletState=0;
sigObj.ImageFileFormat=4;
sigObj.ImageXSize=200;
sigObj.ImageYSize=30;
sigObj.ImagePenWidth=11;
sigObj.JustifyMode=5;
sigObj.WriteImageFile("C:\\SigImage.JPG");
var objField1 = XDocument.DOM.selectSingleNode("//my:myFields/my:field1");
objField1.text = "C:\\sigimage.jpg";
}
If I could somehow generate an unique ID and pass it as a variable to the WriteImageFile() function and associate it back to objField1.text then I think it might work. I would greatly appreciate any insight, suggestions, advice anybody can spare!
Thanks!
Jimmy