canvgc
canvgc
is a nodejs tool for compiling SVG to html5 CanvasRenderingContext2D commands.
Version
0.1.3
Installation
npm install canvgc
Example
"w": 100 "h": 100 "d": { $; pstack++; $strokeStyle = "rgba(0,0,0,0)"; $miterLimit = 4; $font = " 10px sans-serif"; $; $; pstack++; $fillStyle = "red"; $strokeStyle = "black"; $; $; $; $; $; $; pstack--; $; pstack--; } "i": {}
Usage (Server Side)
canvgc file.svg file.js # basic conversion canvgc file.svg file.js --prepend 'window.canvgc={"file":' --append '};' # assign to some variable canvgc file.svg file.js --prepend 'callback(' --append ');' # call a function with result canvgc file.svg file.js --chunk 500 # break in to blocks of code (prevent event loop starvation when rendering large files)
Usage (Client Side)
// basic render at original width & height, without transforms { var painter = plan{window;}; // can use setImmediate poly-fill canvaswidth = planw; canvasheight = planh; // need to wait on load images - even for dataURL images. painter } ;
Credits
Gabe Lerner (gabelerner@gmail.com) - http://code.google.com/p/canvg/
Michael Thomas - https://code.google.com/p/jscapturecanvas/
Thank You
To the authors of all of the projects on which this depends & is built upon.