marionebl / dom-to-svg

Convert arbitrary DOM trees to SVG

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

🚧 Work In Progress

Convert arbitrary DOM trees to SVG

dom-to-svg

  • Recreate HTML styling in SVG faithfully
  • Mirror input DOM tree in SVG structure
  • Preserve text for scraping and editing

dom-to-svg converts DOM trees to SVG images that recreate the exact style of the input document.

The output is optimized to serve as exchange format for various vector-based image manipulation tools, such as Sketch or Figma.

Usage

import {domToSvg} from "dom-to-svg";

const svg = domToSvg(document.body);
document.appendChild(svg);

Contribute to dom-to-svg

yarn
yarn start

License

dom-to-svg is licensed under the MIT license. Copyright 2018 - present Mario Nebl.

About

Convert arbitrary DOM trees to SVG

License:MIT License


Languages

Language:TypeScript 99.8%Language:JavaScript 0.2%