Jump to content

Signature from mobile


frios

Recommended Posts


Is there someone who know how to capture the signature from a mobile??

I've been trying to apply  javascript libraries for several days, but, or d'ont work or I can not get them to communicate with Unigui to send them to database.

I really need it.

Any idea will be welcome.

Thanks in advance

Link to comment
Share on other sites

Thank you,
From your message I have reached another, where there is an example, which I had already seen, but it did not work correctly. I suppose the versions of the library were not correct. I added a call to a function that was missing ... and to work.

I enclose the corrected example in case it serves you.

regards
Felix

 

Edit: I have put the component libraries in a post below

mobile_sig_test.zip

Edited by frios
More text
  • Like 3
Link to comment
Share on other sites

  • 1 month later...
On 3/7/2019 at 11:32 AM, frios said:

Thank you,
From your message I have reached another, where there is an example, which I had already seen, but it did not work correctly. I suppose the versions of the library were not correct. I added a call to a function that was missing ... and to work.

I enclose the corrected example in case it serves you.

regards
Felix

mobile_sig_test.zip

Hi Felix,

I'm trying to run your project but get several error messages ("resizeCanvas is not defined" etc.).

Can you please include your CustomFiles to your project:

files/signature_pad.js
files/points.js
files/app.js
files/css/signature-pad.css

Thank you.

Link to comment
Share on other sites

  • 1 year later...
  • 1 year later...

So, saving signature to file works fine but I canno make loading from file and displaying in HTMLFrame.

I have got following code to reverse save operation

        img := TUnimImage.Create(self);
        DM.ZapSel.FieldByName('PODPIS').SaveToFile(podpisName + 'podpis.png');
        img.Picture.LoadFromFile(podpisname + 'podpis.png');
        stream := TBytesStream.Create();
        img.Picture.Graphic.SaveToStream(stream);
        base64s := EncodeBase64(Stream.Memory, stream.Size);
        UniSession.AddJS('ajaxRequest('+ signFrame.JSName +', "_loadimg", ["_src="+signaturePad.fromDataURL("data:image/png;base64,'+ base64s + '")])');
        stream.Free;
        FreeAndNil(img);

 

I see in debug that base64s variable has the samevalue as saved previosuly image. It looks that ajaxRequest is causing a problem. After this I got a message "Invalid or unexpected token" from my Application.

 

So I have found a solution to remove CRLF after encoding to base64

base64s := StringReplace(base64s, #$D#$A,'',[rfReplaceAll]);

and now I have got a message "Cannot read properties of undefined (reading 'fromDataURL')"

Any tip for that?

Thanks for any help?

 

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...