signature image in a form - InfoPath Dev
in

InfoPath Dev

signature image in a form

Last post 10-12-2010 06:40 PM by Patrick Halstead. 14 replies.
Page 1 of 1 (15 items)
Sort Posts: Previous Next
  • 10-11-2010 03:03 AM

    signature image in a form

    I've developed an infopath form in infopath 2007 that it has need to signed by an operator, i nedd simply to apply an image of the sign.

    I would this trying to obtain the sign automatically from a sharepoint workflow.

    It's possible through wf to populate a field into infopath form?

    What kind of data source can i use?  a rich text box or a section?

    Can you help me?

  • 10-11-2010 06:38 AM In reply to

    Re: signature image in a form

     Hi, I think you can do it with a RT box and some codes. you add an on sign event, and you modified this field with some HTML like:

    <div><img src="IMG Path" /></div>

    If you need some help for your code, you can ask me.

  • 10-11-2010 07:17 AM In reply to

    • andy_t
    • Not Ranked
    • Joined on 10-10-2010
    • Posts 9

    Re: signature image in a form

    I'm about to try the same thing.....  I'm thinking of putting the image files into a SharePoint library, then use a data connection to retrieve the node list, indexed to the user who's signature I want, and a rule tied to a check box to update the image box.  That way I won't need any code, and I should be able to still make it a browser enabled form.

     andy t.

    Andy_T
    Technology Manager, Puget Sound Clean Air Agency
    Seattle, WA
  • 10-11-2010 07:32 AM In reply to

    Re: signature image in a form

     You can still make it browser enable if you use C# or VB, with a data connection, you can't have an image, but it's ok because you just need a path.

    With rules, you can just change the text value. if you want to do that without code, you can add all your image on the form in some section, and then add some conditionnal formatting to just show one image of the personn who have sign.

  • 10-11-2010 07:34 AM In reply to

    Re: signature image in a form

    what kind of library do you think to use? picture library or a doc library andy t.?

  • 10-11-2010 07:57 AM In reply to

    Re: signature image in a form

     If, you just want to use rules, a document library is not necessary, anyway a data connection, can't retrieve an image. you can just add your image on your form template in a section and then, add a conditionnal formatting on this section to hide or show your image.

  • 10-11-2010 09:25 AM In reply to

    Re: signature image in a form

    Yes but including the image in a form constraint me to update every time the there is a new person that sign the form, if i have a external doc lib, can be populated from others and from the form i retrieve the sign image automatically.

  • 10-11-2010 09:30 AM In reply to

    Re: signature image in a form

     Yes that's true, but I just see a solution with code, if you want to do that "dynamically".

  • 10-11-2010 10:16 AM In reply to

    • andy_t
    • Not Ranked
    • Joined on 10-10-2010
    • Posts 9

    Re: signature image in a form

    Right now I'm using a picture library.  One issue I've found is the [file]Name field is not exposed in the Data Connection.  To get around that I just created a new list column to store the file name.  I haven't found a way to insert the binary file data which Infopath requires for a "picture" control.  I'm playing with using a RichText control and trying to embed the HTML <img> tag with the URL to my signature.jpg file.  I can manually do it.... but so far my rule isn't working to make it automated.

    andy t.

    Andy_T
    Technology Manager, Puget Sound Clean Air Agency
    Seattle, WA
  • 10-11-2010 10:25 AM In reply to

    Re: signature image in a form

     As I told you before with the rules you will be able to modify the text only not the inner xml, so if you try to add "<img ..."with rules, he just add  &lt;img...to display it

    The inner xml can only be modified  with codes.

  • 10-11-2010 01:22 PM In reply to

    • andy_t
    • Not Ranked
    • Joined on 10-10-2010
    • Posts 9

    Re: signature image in a form

    I'm so close.......   You can't just add the "<img..... />" tag.  You have to direct Infopath to deal with this as inline HTML, so the syntax is:

    concat('<html xmlns="http://www.w3.org/1999/xhtml" xml:space="preserve"><div><img src="http://YourServer/Signatures/', User[Title = appvlMngrName], '.jpg" alt="" /></div></html>')

    This "ALMOST" works, except Infopath translates the "<" and ">" to "&lt;" and "&gt;".....  If you input as "&lt;html"  then Infopath will translate it to "&amp;lt;"...  So, I need to figure out how to get the string into the XML file as a literial string.....   As it is now, if I hand edit the XML file after it's stored in SharePoint and replace "&lt; and &gt;"  with "< and >" then save it as a new revision it works fine.

    So close.......

    Andy_T
    Technology Manager, Puget Sound Clean Air Agency
    Seattle, WA
  • 10-11-2010 03:03 PM In reply to

    • andy_t
    • Not Ranked
    • Joined on 10-10-2010
    • Posts 9

    Re: signature image in a form

    I took a look at the XSLT file Infopath creates and found a problem.....  Infopath uses <xsl:copy-of> to reference the XML element (string) I am plugging in from my rule.  Therefore, there is no way to do a disable-output-escaping="yes" like you can do w/ <xsl:value-of> to preserve the "<" and "<" characters.    I'm going to see if I can hand tweak the XSLT file (as soon as I can find a CAB file editor). I'm not sure if Infopath calculates a checksum on the file, so I guess I may have to edit the manifest file if need be.

    Andy_T
    Technology Manager, Puget Sound Clean Air Agency
    Seattle, WA
  • 10-11-2010 09:32 PM In reply to

    Re: signature image in a form

    InfoPath allows you to Save As Source Files. To recab, you can just right-click and design the manifest.xsf file. It will save the solution as an XSN, i.e. CAB file again. No checksum is calculated, but some edits won't roundtrip. To ensure roundtripping, wrap the change in xdPreserve. Search for that on this site to learn more. Best of luck!

    Patrick Halstead
    Project Manager at Qdabra
  • 10-12-2010 09:42 AM In reply to

    • andy_t
    • Not Ranked
    • Joined on 10-10-2010
    • Posts 9

    Re: signature image in a form

    I found a way to add a signature image to a form without doing any codeing, but it isn't eloquent....  My goal for this exercise was to have a SharePoint list that contained a digitized (image) signature for users and managers to be inserted on a form; which I've accomplished.

    Infopath Limitation: When using a picture box control, the control will only accept encoded binary data.  Using a RichText control allows a URL to be passed, but it encodes the "<" and ">" so it won't translate correctly with the encoded replacemenets "&lt: / &gt;" in the XML. (see above comments)

    Solution:  Store the encoded binary data for the picture in the SharePoint library.  In SharePoint I created a Picture library and added a few extra columns (User and PicData).  The "User" field matches a user's AD user name string so I could do an easy look up to match the current user to their signature.  PicData is a multi-line text field with "no size limit" selected. By placing the encoded binary data for the image in this field, I am now able to define a DataConnection back to my Signature Library and retrieve the encoded data.  I tie a rule to a checkbox to update the 'appvlSignature' control on my form. This way, when the approver checks the "isApproved" box the binary image data is stuffed into the picture control, thus updating the image.

    It's not a great solution, so no flames....   In my case I have around (50) signatures, so the set up to encode the files it's too cumbersome.  Additionally, by using this approach I don't need to utilize a developer, nor do I need to manage any extra code in the form.  This means I can train ordinary office staff (familiar with Infopath) to use the built in functions without the need for special coding; It's just a matter of creating the data connection, and writing some basic rules.

     andy t.

    Andy_T
    Technology Manager, Puget Sound Clean Air Agency
    Seattle, WA
  • 10-12-2010 06:40 PM In reply to

    Re: signature image in a form

    Hio Andy_T,

    Sorry not to mention this earlier, but Mel has written three blogs on our solution for this: http://www.infopathdev.com/search/SearchResults.aspx?q=qesXTP

    Please take a look at http://www.infopathdev.com/blogs/mel_balsamo/archive/2009/03/02/electronic-signature-template-part.aspx and let us know whtat hte difference is for your stuff and ours. We have quite a few people using this.

    Best!

     

    Patrick Halstead
    Project Manager at Qdabra
Page 1 of 1 (15 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.