I created a Patient Information Form with a field to take signatures from a signature pad (Sig Plus).
I got the form to work with the signature pad but what happens is the picture image is only good until a new Patient Information Form is filled out. Reason being is because I had to create a location where the signature would be stored (as a picture) so that info path can retreive it in the form in the correct feild from that location. As a result when a new form is filled out the old sinatures are replaced with the new. because of the code.
Is there and way i can generate the name of the picture so it can be different every time it is called so i can still have the old signatures when i go back and look at an old form?
Here is the code I used:
/*
* This file contains functions for data validation and form-level events.
* Because the functions are referenced in the form definition (.xsf) file,
* it is recommended that you do not modify the name of the function,
* or the name and number of arguments.
*
*/
// The following line is created by Microsoft Office InfoPath to define the prefixes
// for all the known namespaces in the main XML data file.
// Any modification to the form files made outside of InfoPath
// will not be automatically updated.
//<namespacesDefinition>
XDocument.DOM.setProperty("SelectionNamespaces", 'xmlns:my="http://schemas.microsoft.com/office/infopath/2003/myXSD/2006-05-30T23:54:07"');
var sigObj = new ActiveXObject("SIGPLUS.SigPlusCtrl.1");
//</namespacesDefinition>
//=======
// The following function handler is created by Microsoft Office InfoPath.
// Do not modify the name of the function, or the name and number of arguments.
//=======
function CTRL1_5::OnClick(eventObj)
{
sigObj.InitSigPlus();
sigObj.OpaqueMode=true;
sigObj.TabletState=1;
}
//=======
// The following function handler is created by Microsoft Office InfoPath.
// Do not modify the name of the function, or the name and number of arguments.
//=======
function CTRL2_5::OnClick(eventObj)
{
sigObj.TabletState=0;
sigObj.ImageFileFormat=4;
sigObj.ImageXSize=200;
sigObj.ImageYSize=75;
sigObj.ImagePenWidth=11;
sigObj.JustifyMode=5;
sigObj.WriteImageFile("M:\\sigim\SigImage1.JPG");
var objField1 = XDocument.DOM.selectSingleNode("//my:myFields/my:field1");
objField1.text = "M:\\sigim\SigImage1.JPG";
}
//=======
// The following function handler is created by Microsoft Office InfoPath.
// Do not modify the name of the function, or the name and number of arguments.
//=======
function CTRL105_5::OnClick(eventObj)
{
sigObj.InitSigPlus();
sigObj.OpaqueMode=true;
sigObj.TabletState=1;
}
//=======
// The following function handler is created by Microsoft Office InfoPath.
// Do not modify the name of the function, or the name and number of arguments.
//=======
function CTRL106_5::OnClick(eventObj)
{
sigObj.TabletState=0;
sigObj.ImageFileFormat=4;
sigObj.ImageXSize=200;
sigObj.ImageYSize=75;
sigObj.ImagePenWidth=11;
sigObj.JustifyMode=5;
sigObj.WriteImageFile("M:\\sigim\SigImage2.JPG");
var objField100 = XDocument.DOM.selectSingleNode("//my:myFields/my:field100");
objField100.text = "M:\\sigim\SigImage2.JPG";
}
//=======
// The following function handler is created by Microsoft Office InfoPath.
// Do not modify the name of the function, or the name and number of arguments.
//=======
function CTRL107_5::OnClick(eventObj)
{
sigObj.InitSigPlus();
sigObj.OpaqueMode=true;
sigObj.TabletState=1;
}
//=======
// The following function handler is created by Microsoft Office InfoPath.
// Do not modify the name of the function, or the name and number of arguments.
//=======
function CTRL108_5::OnClick(eventObj)
{
sigObj.TabletState=0;
sigObj.ImageFileFormat=4;
sigObj.ImageXSize=200;
sigObj.ImageYSize=75;
sigObj.ImagePenWidth=11;
sigObj.JustifyMode=5;
sigObj.WriteImageFile("M:\\sigim\SigImage3.JPG");
var objField101 = XDocument.DOM.selectSingleNode("//my:myFields/my:field101");
objField101.text = "M:\\sigim\SigImage3.JPG";
}
//=======
// The following function handler is created by Microsoft Office InfoPath.
// Do not modify the name of the function, or the name and number of arguments.
//=======
function CTRL109_5::OnClick(eventObj)
{
sigObj.InitSigPlus();
sigObj.OpaqueMode=true;
sigObj.TabletState=1;
}
//=======
// The following function handler is created by Microsoft Office InfoPath.
// Do not modify the name of the function, or the name and number of arguments.
//=======
function CTRL110_5::OnClick(eventObj)
{
sigObj.TabletState=0;
sigObj.ImageFileFormat=4;
sigObj.ImageXSize=200;
sigObj.ImageYSize=75;
sigObj.ImagePenWidth=11;
sigObj.JustifyMode=5;
sigObj.WriteImageFile("M:\\sigim\SigImage4.JPG");
var objField102 = XDocument.DOM.selectSingleNode("//my:myFields/my:field102");
objField102.text = "M:\\sigim\SigImage4.JPG";
}____________________________________________________________________
BELOW YOU WILL FIND A LINK TO SEE A PIC OF HOW THE FORM LOOK.
http://meddentco.com/PIF.jpg