[Signature] Return strokes using Signature

[Signature] Return strokes using Signature

  
Forge Component
(12)
Published on 2017-06-20 by Magda Pereira
12 votes
Published on 2017-06-20 by Magda Pereira

Is it possible to record the strokes made by the users? The movement on x and y co-ordinates I mean.

Hum...

You mean, using the Signature component?
As it is, no, it isn't.

Cheers,
Eduardo Jauch

Hi Saurav,

To get the strokes, you need to modify the Component:

  • Open the Signature module
  • Edit the Javascript property of the jSignature webblock
  • In the line where it is:
$('#' + this.textbox).val(this.signObj.jSignature('getData'));

change it to 

$('#' + this.textbox).val(this.signObj.jSignature("getData", "svgbase64"))
  • That will get you the strokes instead of the image
  • Publish it and use it in your module

Disclaimer: 

I have not tried it. I'm basing the above information on the documentation for the jSignature jQuery plugin:

http://willowsystems.github.io/jSignature/#/about/

You can also get other type of data besides the bitmap or the svgbase64 (see the above link).

Cheers,

José