You can add a form field that lets the user draw their own signature with the mouse or a stylus on a touch-sensitive screen. This makes use of the JavaScript library jSignature. Xima® Formcycle already includes this library and makes it available to all forms. To use the handwritten signature feature, you do not need to take any futher steps or include the library manually.

For the standard use case, there is no need to interact with the library via own custom JavaScript. Advanced users may initialize a signature field manually with the corresponding jQuery method, see also the documentation on jQuery.fn.jsignature.

Enabling handwritten signatures

Add the attribute signature to a textarea. This converts it to an input field for a handwritten signature.

To convert an input field to an input field for a handwritten signature:

  • Add a form element of type textarea to the form
  • Give this textarea the attribute signature with the value signature

You should also set the Max. length to 0 in the constraints section of the properties panel. This removes the length restriction for the textarea. The image is saved as a base64 string which may be long.

Working with the signature image

When you open a form record in the inbox, the signature shows up as an image, exactly as drawn by the user.

Internally, the signature is encoded as a base64 string and saved in the textarea.

When you want to add the signature to a PDF document via an action of type PDF (Fill), you can use the function b64image. See the help page on preparing a PDF document for further details.

Tags:
Copyright 2000-2024