josejad Expert Licensed User Longtime User Aug 21, 2018 #1 Hi: I have a small webpage where I capture a signature and save it in my db into a small text format (base30). https://willowsystems.github.io/jSignature/#/about/ I've made a small html page with a jSignature pad and I load it into a WebView. I would like to get the base30 string from the WebView. Do I need to use WebViewExtras? Or could I get it just with the Webview? See attached a small example. Thanks¡¡ Attachments jsignaturesample.zip jsignaturesample.zip 62 KB · Views: 498
Hi: I have a small webpage where I capture a signature and save it in my db into a small text format (base30). https://willowsystems.github.io/jSignature/#/about/ I've made a small html page with a jSignature pad and I load it into a WebView. I would like to get the base30 string from the WebView. Do I need to use WebViewExtras? Or could I get it just with the Webview? See attached a small example. Thanks¡¡
R ronell Well-Known Member Licensed User Longtime User Aug 22, 2018 #2 it will be much easier using canvas .. see this thread https://www.b4x.com/android/forum/threads/signature-capture-tutorial.9096/ Upvote 0
it will be much easier using canvas .. see this thread https://www.b4x.com/android/forum/threads/signature-capture-tutorial.9096/
josejad Expert Licensed User Longtime User Aug 22, 2018 #3 Thanks ronell, I watched the threads related with signature capture before start trying this solution. If I can't get it work, I probably will use the DonMamfred wrap "Signature Capture Dialog", I think it produces smoother images. Well, I'm trying to get the base30 (or base64) value of the signature with WebViewExtras v2. I have this javascript in my html, it returns the encoded string of my signature, and (just testing) it change document.title to the encoded string too. Code: Copy function Base30() { document.title = $('#signature').jSignature('getData', 'base30'); return $('#signature').jSignature('getData', 'base30'); } Now, in my app: Code: Copy Sub Button1_Click Dim Javascript As String Javascript="B4A.CallSub('GetBase30', true, Base30())" WebViewExtras1.ExecuteJavascript(Javascript) End Sub Sub GetBase30(data As String) Msgbox(data, "Enconded Data") Label1.Text = data End Sub The value I get is "undefined", while if I execute my html in a browser, I get the right values. Thanks in advance, Upvote 0
Thanks ronell, I watched the threads related with signature capture before start trying this solution. If I can't get it work, I probably will use the DonMamfred wrap "Signature Capture Dialog", I think it produces smoother images. Well, I'm trying to get the base30 (or base64) value of the signature with WebViewExtras v2. I have this javascript in my html, it returns the encoded string of my signature, and (just testing) it change document.title to the encoded string too. Code: Copy function Base30() { document.title = $('#signature').jSignature('getData', 'base30'); return $('#signature').jSignature('getData', 'base30'); } Now, in my app: Code: Copy Sub Button1_Click Dim Javascript As String Javascript="B4A.CallSub('GetBase30', true, Base30())" WebViewExtras1.ExecuteJavascript(Javascript) End Sub Sub GetBase30(data As String) Msgbox(data, "Enconded Data") Label1.Text = data End Sub The value I get is "undefined", while if I execute my html in a browser, I get the right values. Thanks in advance,
josejad Expert Licensed User Longtime User Aug 23, 2018 #4 I found the solution!! I've posted a example in: https://www.b4x.com/android/forum/t...ring-with-jsignature-and-webviewextras.96451/ Thanks! Upvote 0
I found the solution!! I've posted a example in: https://www.b4x.com/android/forum/t...ring-with-jsignature-and-webviewextras.96451/ Thanks!
S ST500 Active Member Licensed User Longtime User Aug 24, 2018 #5 ronell said: it will be much easier using canvas .. see this thread https://www.b4x.com/android/forum/threads/signature-capture-tutorial.9096/ Click to expand... I used this thread too. Works perfectly. One question: how can I insert the line for the signature? Upvote 0
ronell said: it will be much easier using canvas .. see this thread https://www.b4x.com/android/forum/threads/signature-capture-tutorial.9096/ Click to expand... I used this thread too. Works perfectly. One question: how can I insert the line for the signature?
josejad Expert Licensed User Longtime User Aug 24, 2018 #6 Insert the line in the canvas sample, do you mean? Sorry, I haven't worked with canvas, but I suppose you should draw the line. I guess this thread could help you: https://www.b4x.com/android/forum/threads/drawing-lines-on-canvas.74810/ Upvote 0
Insert the line in the canvas sample, do you mean? Sorry, I haven't worked with canvas, but I suppose you should draw the line. I guess this thread could help you: https://www.b4x.com/android/forum/threads/drawing-lines-on-canvas.74810/
S ST500 Active Member Licensed User Longtime User Aug 24, 2018 #7 Thanks a lot Jose. That will help me. Upvote 0