dom-imagify

0.1.5 • Public • Published

dom-imagify

fork from dom-to-image

Install

npm install --save dom-imagify

Usage

import {toPng} from "dom-imagify"

const extraStyles = `
@font-face {
    font-family: Roboto;
    src: url(//xxx.xxx.com/roboto-thin.eot);
    font-weight: 200
}
`

toPng(document.body,{
    extraStyles
})
.then(function (dataUrl) {
    var link = document.createElement('a');
    link.download = new Date().getTime()+'.png';
    link.href = dataUrl;
    link.click();
})

Readme

Keywords

none

Package Sidebar

Install

npm i dom-imagify

Weekly Downloads

1

Version

0.1.5

License

MIT

Unpacked Size

50.4 kB

Total Files

6

Last publish

Collaborators

  • janrywang