0.2.5 • Published 7 years ago

to-png v0.2.5

Weekly downloads
13
License
MIT
Repository
github
Last release
7 years ago

to-png

An easy way to create PNG image from given DOM element.

Usage

import toPng from 'to-png';

const element = document.getElementById('source')
toPng(element)
  .then(image => {
    // do something with the image
    console.log(image.dataUrl);
  })
  .catch(err => {
    // do something with the error
    console.error(err);
  });

API

toPng(el, scale=1)

el - The DOM element to convert to PNG.

scale - A Number greater than 0 and less than 10 that scales the size of the image.

Known Issues

This library does not work with Internet Explorer or Edge browsers due to these browsers not supporting the foreignObjects tag in SVG.

0.2.5

7 years ago

0.2.4

7 years ago

0.2.3

7 years ago

0.2.2

7 years ago

0.2.1

7 years ago

0.2.0

7 years ago

0.1.4

7 years ago

0.1.3

7 years ago

0.1.2

7 years ago

0.1.1

7 years ago

0.1.0

7 years ago