問題描述
Raphael JS 服務器端 (Raphael JS server-side)
I'm using Raphael js to create some graphics on the client. But I'd now like to be able to do the same thing directly on the server to be able to create them and store them in batch.
I've found solutions where the SVG form Raphael is fetched from the client, but not any completely server-side.
Does any one have experience using Raphael js server side only (with Rhino for instance)?
Thanks!
參考解法
方法 1:
Take a look at PhantomJS - it's basically a full webkit browser you can run headless from the command line and render the output to a PNG.
There is actually an example using Raphael on the Quickstart guide.
phantomjs rasterize.js http://raphaeljs.com/polar-clock.html clock.png