mirror of
https://github.com/niklasvh/html2canvas.git
synced 2023-08-10 21:13:10 +03:00
26 lines
528 B
Markdown
26 lines
528 B
Markdown
|
---
|
||
|
title: "Getting Started"
|
||
|
---
|
||
|
|
||
|
# Installing
|
||
|
|
||
|
You can install `html2canvas` through npm or [download a built release](https://github.com/niklasvh/html2canvas/releases).
|
||
|
|
||
|
### npm
|
||
|
|
||
|
npm install html2canvas
|
||
|
|
||
|
```javascript
|
||
|
import html2canvas from 'html2canvas';
|
||
|
```
|
||
|
|
||
|
# Usage
|
||
|
|
||
|
To render an `element` with html2canvas with some (optional) [options](/configuration/), simply call `html2canvas(element, options);`
|
||
|
|
||
|
```javascript
|
||
|
html2canvas(document.body).then(function(canvas) {
|
||
|
document.body.appendChild(canvas);
|
||
|
});
|
||
|
```
|