Infopath Signature Size Hack


Many times I have trouble with the size of the signature block in InfoPath forms. It blows up the form so much that it requires a second page to print just because of the size of the signature block(s). This looks very bad when I have to redo PDF forms in InfoPath so we can use the content on SharePoint. In PDF forms you can squeeze a signature in any kind of block size and make the form print-out stay within the margins of one page. Therefore I needed to find a hack to makes the signature field smaller in InfoPath.

Might need some more work, but I’m happy with the result at the moment.

Here is the trick:
1. Finish designing the form as you usually would. As always make a backup copy of the .xsn file before applying modifications.
2. Copy the formname.xsn file to a folder, rename formname.xsn to, and unpack it with Winzip.
3. Find the *.xsl stylesheet for the form view you want to modify. If you created more than one view you should have more than one *.xsl stylesheet.
4. Open the *.xsl stylesheet with an editor like notepad
5. Copy the below CSS code into the header of the form – somewhere at the end

<style> ...

.defaultInDocUI {
.defaultInDocUI TD IMG{

Somewhere in the header you will also find:

.defaultInDocUI {
FONT-FAMILY: Verdana; FONT-SIZE: xx-small

You can also modify the font and font size here directly.

6. Save the .xsl file
7. Look at the result by opening the form with right-clicking the manifest file and selecting DESIGN; and of course “Form Preview” in the InfoPath application.
8. Probably you want to make modifications to the font size and/or the IMG size until it fits your needs
9. Save the form by overwriting the .xsn form file and the modifications are preserved.

The stylesheet modifications are preserved. You can now even further design the form if you like and save it as usual by overwritting the .xsn file.
Do not try to make modifications directly in the xsl stylesheet code. Everytime you save the form InfoPath will overwrite your modifications with standard content. The only thing that might be possible would be to publish it directly into SharePoint. However, every time you need to further design the form you would have to redo the modifications to the stylesheet. There is also a way to apply an external CSS stylesheet to the form but that doesn’t seem to work with browser-based forms.

One last thing. By changing the image width to 0 px you hide all images around the signature block, also the name section. I did try to leave the images for the red seal image intakt, but I could not find the right CSS selector to get to them. Maybe you will find a way…

Here is how the signature block looks afterwards (the “View Details” link will also still work)

Is this Pages usefull? Usefull Useless 0 of 0 people say this Pages is usefull.