0

I'm using Raphael to sketch in my web application: http://ianli.com/sketchpad/

Raphael SketchPad allows to generate json code from the sketch, and to redraw it back, as you can see in the demo.

Now having this json code, is there anyway to regenerate an image file with the sketch (that i can save in my computer)?

  • Either, generating the file in the client side (Javascript).
  • Or with the json code, recreate the sketch on the server (Java).

(I prefer the later approach).

Thank you.

Majid Laissi
  • 19,188
  • 19
  • 68
  • 105

1 Answers1

1

The Raphael Sketchpad website says that it can turn its JSON output back into a Raphael drawing using the "viewer" functionality like so:

var sketchpad = Raphael.sketchpad("viewer", {
    width: 400,
    height: 400,
    strokes: sketchpadJSONgoesHere,
    editing: false
});
Owen Masback
  • 420
  • 1
  • 4
  • 10
  • yes that's what I said in my OP, but I need to *save* the sketch as an image file in my computer – Majid Laissi May 02 '13 at 00:43
  • Ok, so by "hard image" you mean a file. how do you generate and save a file from the SVG output that Raphael and Sketchpad created. This question has been asked a couple times: http://stackoverflow.com/questions/10120975/how-to-save-an-svg-generated-by-raphael, http://stackoverflow.com/questions/2483919/how-to-save-svg-canvas-to-local-filesystem – Owen Masback May 02 '13 at 01:15