I am writing an application that allows users to create images with Raphael.JS. One of the secondary features that I want is to create a Raphael PNG canvas.
Here is a common pipeline in my head:
- User enters parameters
- We generate JS with Raphael calls
- We create a JS wrapper that does the above and calls .innerHTML in the containing div, providing us with SVG (which we then send somewhere)
- We run the JS shell
- SVG is sent to ImageMagick and issues PNG
Step 4 is the step that I need to follow. User can use IE; we do not guarantee that JS is ever executed in the SVG browser. In any case, we need this to work on the server side, so that it is reliable. So, here are three possibilities that I have come up with so far:
- Install Firefox on the server and run the result (3) in Firefox. This option sucks because installing FF means installing a bunch of X-materials on our server, running FF carries a lot of overhead, and I really don't want to guess by tracking the process and killing it when it's done.
- Node.js + jsdom (http://github.com/tmpvar/jsdom). , , jsdom - jsdom.org . , .
- , - ? , Rhino DOM, Node.
... . . - ? ?