How To: Add Signature Capture to your Form - Mel Balsamo Sign in | Join | Help in Mel Balsamo Tutorials (Entire Site) InfoPath Dev InfoPath Dev is dedicated to bringing you the information and tools you need to be successful in your Microsoft Office InfoPath development projects. Home Blogs Forums Photos Downloads This Blog Home Syndication RSS Atom Comments RSS Recent Posts How To: Save Images to SharePoint How To: Capture Camera Images How To: Add Signature Capture to your Form Query Forms from within other Forms Create a Child Form from within a Parent Tags Active Directory activeX Address block aduserinfo Advanced Contact approval AttachToSharePointList browser forms buttons calculated value Camera Capture Image Capture Signature child code contact block Contact lookup contact selector CopyTable DAT data validation Database Enumeration DBXL DBXL v2.2 DBXL v2.3 DeleteAttachment Design Checker error Electronic Signature email email forms EnumDB expense report external users footer FormsViewer header hide show section How To HREF Image image picker ImagePicker InfoPath InfoPath 2007 IPFS leave request link list lists Mobile parent PI policy public and private forms Qdabra Qdabra Email Builder Tool Qdabra Vertical Tabs XTP QdModifyPI Tool qESxtp qRules query forms QueryDB RefreshSharePointListItems repeating repeating data repeating group repeating section repeating table Save images to SharePoint SaveToSharePoint secondary data source send emails separate libraries SetValue SharePoint sharepoint list Signature smart links split forms submit forms SubmitToSharePointList tabbing template part Vertical tabs Web Service workflow XTP Archives September 2017 (3) March 2017 (3) January 2013 (1) July 2012 (1) October 2011 (1) July 2011 (1) June 2011 (2) March 2011 (1) December 2010 (4) November 2010 (1) May 2010 (3) February 2010 (1) January 2010 (1) December 2009 (3) September 2009 (2) July 2009 (2) June 2009 (1) May 2009 (3) March 2009 (3) February 2009 (1) January 2009 (2) December 2008 (1) Mel Balsamo How To: Add Signature Capture to your Form Prerequisites: You should already have FormsViewer installed and understand how to upload and open forms. You should have an XSN form template that has been injected with qRules. You should have the Signature Prototype form included with this document (Download the package here) Steps: Export all resource files except QdabraRules.xml from the Signature Prototype XSN. Add the .js and .css files to your own XSN as resource files. Add a Section control to your form. This will serve as a placeholder for the signature control. Place some placeholder text in this section control, like “Find me”. You will use this in step 7 to locate the section in the form’s source in step 7. Add a Picture control to your form along with a corresponding base64 (Picture or File Attachment) field. When you select Picture from the Controls pane, select the option to include it in the form. Place this inside the Section control from step 3. Click the control to select it and add a formatting rule to hide it when it is blank. Add a button to the view for the purposes of showing the signature control. Give this button some text like “Sign this form” and a meaningful ID. Make note of this ID for use in step 8. Save the form as an XSN file and extract its source. If you are unsure how to extract the form’s source, you can do this: Click the File tab Click Publish Click Export Source Files Locate or create a folder where the source files will be extracted. This will create several files in the destination folder, so it is usually best to select an empty folder or create a new folder for this. Click OK Locate the source files you extracted, and use a text editor to open the view XSL file corresponding to the view where you are adding the signature control. Locate the Section control you created in step 3. It will most likely be in the format CTRL[number] make note of this ID for use in the next step. If you are not sure how to locate the Section control, you can do the following: Within the text editor, search for the placeholder text you added in step 3 (e.g. “Find me”). When you’re done with all the steps in this document, you may delete this placeholder text. This should take you to roughly the location of the Section control. Look in the near vicinity of the located placeholder text for a <div> tag with an xd:xctname="Section" attribute. Make a note of the xd:CtrlId attribute on this tag. (e.g. CTRL3) Edit the SignatureConfig.xml from the exported resource files of the Signature Prototype XSN and add the needed config settings. Open the XML in a text editor such as Notepad. ButtonId is the button ID from step 5. PlaceholderId is the ID of the Section control that you determined in step 7. DestPath is the full XPath of the picture field from step 4. Back in the InfoPath Designer, go to Data > Data Connections and add a receive XML data connection for your modified SignatureConfig.xml – name it SignatureConfig. On the finishedLoading field in the QdabraRules data source, add a rule to load the .js and .css files using LoadResource. (You can imitate the rule in the same location in the sample form. It should involve three LoadResource commands: LoadResource /name=jquery.signaturepad.min.js LoadResource /name=Signature.js LoadResource /name=Signature.css Save, upload the form to FormsViewer, and try it out. Click the button you added in step 5 to reveal the signature control. Add a signature by clicking and dragging your mouse across the gray area. Click Capture Signature to capture an image of the signature. This will store an image of the signature in your image field and hide the signature control. (As needed) To add more signature controls to the same form, repeat steps 3-9. In step 8, add one <Signature> element to the SignatureConfig file for each signature control and update the SignatureConfig data source instead of creating a new one. Published Sep 05 2017, 04:19 AM by Mel Clemente Filed under: InfoPath, FormsViewer, Signature, Mobile, Capture Signature Comments No Comments Copyright © 2003-2019 Qdabra Software. All rights reserved.View our Terms of Use.