1.2.3 • Published 4 years ago
htmlsvg v1.2.3
htmlsvg
converts html element to svg element (rect,text,img).
online demo:
Install
$ npm install htmlsvg
Usage
import htmlToSvg from "htmlsvg";
const htmlElement = document.getElementById("DivId");
const svg = await htmlToSvg(htmlElement);
console.log(svg);
You can directly download svg with passing config object
import htmlToSvg from "htmlsvg";
const svgConfig = {
downloadSvg: true,
filename: "htmltosvg",
};
const htmlElement = document.getElementById("DivId");
const svg = await htmlToSvg(htmlElement, svgConfig);
console.log(svg);
You can directly download png with passing config object
import htmlToSvg from "htmlsvg";
const svgConfig = {
downloadSvg: true,
downloadPng: true,
convertDataUrl: true, // you need to convert images to dataurl if you wanna download png image
filename: "htmltosvg",
};
const htmlElement = document.getElementById("DivId");
const svg = await htmlToSvg(htmlElement, svgConfig);
console.log(svg);
1.2.3
4 years ago
1.2.2
4 years ago
1.2.0
4 years ago
1.2.1
4 years ago
1.1.18
4 years ago
1.1.17
4 years ago
1.1.16
4 years ago
1.1.15
4 years ago
1.1.14
4 years ago
1.1.13
4 years ago
1.1.9
4 years ago
1.0.9
4 years ago
1.0.8
4 years ago
1.0.7
4 years ago
1.0.6
4 years ago
1.0.5
4 years ago
1.1.12
4 years ago
1.1.11
4 years ago
1.1.10
4 years ago
1.0.4
4 years ago
1.0.3
4 years ago
1.0.2
4 years ago
1.0.1
4 years ago
1.0.0
4 years ago