Download an SVG element as an SVG or PNG file, including CSS defined styles.
[Fork] A modern, updated, typescript version of the popular Javascript library Hypercubed/svgsaver.
NOTE: THIS LIBRARY IS NOT READY FOR PRODUCTION AND IS ONLY USED INTERNALLY IN rainbow-board.
var
replaced with newer alternatives.<svg>
by element object.The package is available on NPM under the name svgsaver-reboot
import { SVGSaver } from 'svgsaver-reboot';
const svg = document.querySelector('#mysvg');
const saver = new SVGSaver(svg); // Can convert to PNG, dataURL, Blob or save directly.
saver.saveAsSVG(svg);
Forked from the popular library Hypercubed/svgsaver.
Based on previous work on Hypercubed/angular-downloadsvg-directive. Some portions of this code inspired by raw and moagrius/copycss.
Generated using TypeDoc