willowsystems / jSignature

jQuery plugin - draw signature in browser.
714 stars 266 forks source link

Help needed with jsignature formats in Android #15

Open soniaalves opened 11 years ago

soniaalves commented 11 years ago

Hi,

I have this issue with Android:

I have a signature and I need to save it to database. I'm using format data:image/svg+xml;base64 and I save the signature with success! My goal is, try to load the saved signature to an image control. Something like img.src="data:image/svg+xml;base64,xxxxxxxx......" I can load the signature to an image, with this format, with success in various platforms. But when I try the same on Android the signature is not loading in this format.

So my question is: is there a way to convert from data:image/svg+xml;base64 to data:image/png?

Thank you

dvdotsenko commented 11 years ago

Have other data-url-encoded strings worked with Android's image control? Does it accept data-url-encoded PNGs?

Try to unpack the raw svg source from the data-url-encoded string and feed that instead to the image control. Frankly I would be surprised if the image control supports even unpacked, raw SVG.

Quick google search reveals that viewing/rendering SVG-to-bitmap on Android is a bit of a chore:

http://stackoverflow.com/questions/4517388/svg-processing-under-java-on-android-and-desktop/4644781#4644781

https://answers.launchpad.net/libsvg-android/+question/115135