CGDevTools Forum

Welcome to the Official CGDevTools Support Community Forums.

Signature - struggling with basic understanding

General discussion

by TimWinstanley » 28 Dec 2013 20:23

Firstly my apologies if this question is answered elsewhere - please feel free to point me in the right direction if this is the case.


I'm struggling with what I think is basic understanding of how JQuery etc is put together. I'm very much a newbie with web development / intraweb etc.

I'm trying to write a little mobile app that has a number of edit controls and a signature component on it. The idea is that the technician enters a few details, captures the customer signature and then the result is emailed. Capturing the text data is not a problem, neither is emailing - all working beautifully and the signature is at least rendered on the screen :D

However, what I wanted to do then was export the signature in SVG format so that I could either store it in a db or reconstruct it as a file to send as an attachment. The problem is I can't see how the SVG data is generated - so loaded up the CGTools demo and had a look - and the way it works is confusing me. It seems that on selecting the data type (in the demo) that some parameters are hooked up to a button and then that button is re-rendered. My guess was that this causes the "BrowserScript" to be executed and when the button is pressed, the sigdata is available via the event handler.

To try to prove this, I ran the demo, selected the data type *before* drawing a signature to see if this fooled it. It didn't - this left me confused as the data is still available on pressing the export to memo button.

To try to make sense of my question, I'd like to know if it's possible to capture a signature in a known format with only 1 button that also collects the other data on my form at the same time ?

Any brief explanation of how the whole BrowserScript / Params model works would be a nice bonus.


I'm sure I am missing something blindingly obvious and I am happy to read anything suggested - so apologies in advance.



Tim
TimWinstanley
 
Posts: 3
Joined: 27 Dec 2013 18:00

by Jorge Sousa » 29 Dec 2013 16:48

Hi Tim

If it's to save the signature and send to server, you have only

Signature.SaveToImage('path\somefile.png')

That sends always png format.

if you define Signature.OnSaveToStream, you can skip the process of saving directly to path\somefile.png

and store the image content directly in a DB for instance.

You can also work with Signature.OnFileSaved.

About BrowserParams (BrowserScript), these are needed to add more data transported to the server for each event.

This only needed for custom procedures, normally, all the data that is user changeable (like Edit.Text) is automatically synchronized on every ajax/async event or full submit event (Ajax = False).

You can read all the details of cg event class here

http://www.cgdevtools.com/cgforum/viewtopic.php?f=5&t=22
Best Regards
CGDevTools Develop / Support Team
Home Page: http://www.cgdevtools.com
Jorge Sousa
 
Posts: 4261
Joined: 17 May 2012 09:58

by TimWinstanley » 29 Dec 2013 17:47

Excellent - thanks! I'll go and have a read :)

Tim
TimWinstanley
 
Posts: 3
Joined: 27 Dec 2013 18:00

by fjrpilot05 » 04 Feb 2016 22:11

Hi Jorge,

I'm working with the trial download of the JQSignature component. Part of the requirement for this application I'm working on is to display images of signatures that were stored in a sql database using base30. I have confirmed the validity of the data by loading into a modified version of the V2 demo and viewing it correctly onscreen.
From dissecting the V2 demo application I managed to get the data loaded into the component using something like aSignature.JQSignatureOptions.SetData(curSigStr). Its from this point forward I am just trying to get the image out to a png file an an interim step towards get the image into a fastreports report form.

So to try doing this Im trying out the saveasimage('Test.png') functionality you mentioned in your original response. When I try to do this I get an access violation. I am ready to purchase the component suite but I must demonstrate that it will work for us before we can purchase it.

Any help or advice you could offer would be greatly appreciated
Windows 7 64 bit
Delphi XE5
Fast Reports 5
CGDEVTools 2.8.0.181
MSSQL 2012 for data
fjrpilot05
 
Posts: 1
Joined: 04 Feb 2016 15:49

by Alexander Bulei » 05 Feb 2016 10:20

Hi fjrpilot05,

So to try doing this Im trying out the saveasimage('Test.png') functionality you mentioned in your original response. When I try to do this I get an access violation. I am ready to purchase the component suite but I must demonstrate that it will work for us before we can purchase it.


In SaveAsImage function, the FileName should be absolute path with write permissions:

Code: Select all
IWCGJQSignature1.SaveAsImage('C:\temp\test_sign.png');


Anyway, we will make that this function smarter, when path is relative.

Thanks for reporting.

Best Regards.
Group: Developers | Support Team

  • info [at] cgdevtools.com - General information
  • sales [at] cgdevtools.com - Sales department
  • support [at] cgdevtools.com - Product and Technical Support
User avatar
Alexander Bulei
Site Admin
 
Posts: 3635
Joined: 15 May 2012 08:52
Location: Mealhada, Portugal


Return to General

Who is online

Users browsing this forum: No registered users and 3 guests

Contact Us.