Skip to content

Latest commit

 

History

History
18 lines (13 loc) · 526 Bytes

README.md

File metadata and controls

18 lines (13 loc) · 526 Bytes

saveSvgAsPng

To save a PNG, include the script saveSvgAsPng.js in your page, then call the saveSvgAsPng function with an SVG node, a filename, and an optional scaling factor:

saveSvgAsPng(document.getElementById("diagram"), "diagram.png", 3);

If you just want a dataURI for an SVG, you can call svgAsDataUri with an SVG node, a scaling factor, and a callback:

svgAsDataUri(document.getElementById("diagram"), 1, function(uri) {
  ...
});

Compatible with browserify.