Jump to content

Archived

This topic is now archived and is closed to further replies.

simeonC

Help Converting JSON back to an image

Recommended Posts

I have some JSON data that I retrieved from my database which is suppose to represent customers signatures. However I can now capture it but I cannot display it back on to the canvas field because i do not know how..

Is there anyone out there that know how to accomplish this task in the  most simpliest way..

I am currently reading

document from -- since it is his program

http://thomasjbradley.ca/lab/signature-pad/#options-ref

but I cannot seem to get it done

 

Any help would be appreciated Thank you.

Share this post


Link to post
Share on other sites

There is an example right there on the page you linked:

$('.sigPad').signaturePad({displayOnly:true}).regenerate(sig);
Where sig is the JSON data from your database. Have PHP echo out your JSON to a sig variable and then use the line above.

 

var sig = <?php echo json_encode($jsonFromDb); ?>;

Share this post


Link to post
Share on other sites

Well I would love to mark this as answer however I did try all of these and the signature has yet to be displayed.. If anyone can experiment with this and see if you can get it to show let me know.

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.