1.2.3 • Published 3 years ago

htmlsvg v1.2.3

Weekly downloads
-
License
ISC
Repository
github
Last release
3 years ago

htmlsvg

converts html element to svg element (rect,text,img).

online demo:

https://htmlsvg.netlify.app/

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

3 years ago

1.2.2

3 years ago

1.2.0

3 years ago

1.2.1

3 years ago

1.1.18

3 years ago

1.1.17

3 years ago

1.1.16

3 years ago

1.1.15

3 years ago

1.1.14

3 years ago

1.1.13

3 years ago

1.1.9

3 years ago

1.0.9

3 years ago

1.0.8

3 years ago

1.0.7

3 years ago

1.0.6

3 years ago

1.0.5

3 years ago

1.1.12

3 years ago

1.1.11

3 years ago

1.1.10

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago