Customer Signer Action Example (for Pronto version 3.5+ and Classic ASP)
ProntoOpenNet Tuesday, March 31 2009DOWNLOAD: Custom Signer Action Example
This is an example of how collect data from the signer just before they sign and merge the data into the document all while still inside the Pronto automated signature request process. This example is written in classic ASP.
This is the create transaction page
<% Option Explicit Dim sAccount, sPassword, oTrans, sPDF, sBaseURL, sCustomActionURL, oProntoServer, sTransactionResponse sBaseURL = request.ServerVariables("HTTP_HOST") sCustomActionURL = "http://" & sBaseURL & replace(LCase(request.ServerVariables("HTTP_URL")),"createtransaction.asp","CustomSignerAction.asp") sAccount = "Default" sPassword = "password" sPDF = server.MapPath("Documents/EULA.pdf") Set oTrans = Server.CreateObject ("ProntoOpen25.ProntoTransaction35") response.Write ("Create Transaction = " & oTrans.CreateTransaction()) response.Write ("<br>") response.Write ("Set Account = " & oTrans.SetAccount (sAccount, sPassword, "", "", "", "", "")) response.Write ("<br>") response.Write ("Set Response = " & oTrans.SetResponse("http", "")) response.Write ("<br>") response.Write ("Set Return = " & oTrans.SetReturn("none", "")) response.Write ("<br>") response.Write ("Set Jurisdiction = " & oTrans.SetJurisdiction("US", "TX", "us-esign")) response.Write ("<br>") response.Write ("Add Document = " & oTrans.AddDocument("sign", "seq", "Ad Cade Test", "1", "Ad_Cade_Test")) response.Write ("<br>") response.Write ("Add Source = " & oTrans.AddSource (sPDF, "pdf-file-pageimage")) response.Write ("<br>") response.Write ("Add Signer = " & oTrans.AddSignerWithFontImage ("John Smith", "static", "yes", "", "", "no", _ request.form("UID"), "static", "yes", "", "static", "no", "url", "individual", _ "server", "standard-image", "Script", "36", "True", "True", "Blue", "none", "", "none", "yes", _ "thanks.asp?a=4", "no", "US", "TX")) response.Write ("<br>") response.Write ("Add Signer XData = " & oTrans.AddSignerXData (1,50,150)) response.Write ("<br>") response.Write ("Add Signer Action = " & oTrans.AddSignerAction ("pre", "CustomAction", "", sCustomActionURL, "Customer Signer Action")) response.Write ("<br>") response.Write ("<br>") set oProntoServer = Server.CreateObject("ProntoServ25.ServXMLHTTP25") sTransactionResponse = oProntoServer.OpenTransaction(oTrans.GetXML()) response.Write ("Open Transaction = " & sTransactionResponse) response.Write ("<br>") response.Write ("<br>") response.Write ("First Signature URL = " & ParseResponse(sTransactionResponse)) response.Write ("<br>") Function ParseResponse(sResponse) Dim p, x, delimiter, url delimiter = "Doc1:Sig1:URL=" p = instr(1,sResponse,delimiter) p = p + Len(delimiter) x = instr(p,sResponse,";") url = mid(sresponse,p,(x-p)) ParseResponse = "<a href=""" & url & """ target=""_blank"">" & url & "</a>" End Function %>
Here is the Custom Signer Action Page that actually collect the data (CustomSignerAction.asp):
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Classic ASP Signer Action Example</title> <style type="text/css"> body {font-family:Arial;font-size:13px;} div {width:85px;float:left;margin:6px;text-align:right;font-weight:bold;} br {clear:both;} </style> </head> <body style="margin:13px;"> <form method="post" action="/prontosvr2/PdfFormSubmitHtmlPost.asp?<%=request.querystring %>" ><br /><!-- MAKE SURE TO APPEND THE CURRENT QUERYSTRING --> <h3>Classic ASP Signer Action Example</h3> <input id="Hidden1" type="hidden" name="ProntoActionPostType" value="FormFields" /><!-- THIS HIDDEN FIELD IS REQUIRED --> <div>First Name:</div> <input name="FirstName" type="text" value="John" /><br /> <div>Last Name:</div> <input name="LastName" type="text" value="Smith" /><br /> <div>Date of Birth:</div> <input name="DateOfBirth" type="text" value="1/1/1970" /><br /> <div> </div> <input id="Submit1" type="submit" value="Submit" /> </form> </body> </html>