html2canvas/docs/documentation.md

43 lines
1.8 KiB
Markdown
Raw Permalink Normal View History

2017-12-07 18:49:40 +03:00
---
title: "About"
2017-12-10 11:43:34 +03:00
description: "Learn about html2canvas, how it works and some of its limitations"
nextUrl: "/getting-started"
nextTitle: "Getting Started"
2017-12-07 18:49:40 +03:00
---
Before you get started with the script, there are a few things that are good to know regarding the
script and some of its limitations.
2017-12-10 11:43:34 +03:00
## Introduction
2017-12-07 18:49:40 +03:00
The script allows you to take "screenshots" of webpages or parts of it, directly on the users browser.
The screenshot is based on the DOM and as such may not be 100% accurate to the real representation
as it does not make an actual screenshot, but builds the screenshot based on the information
available on the page.
2017-12-10 11:43:34 +03:00
## How it works
2017-12-07 18:49:40 +03:00
The script traverses through the DOM of the page it is loaded on. It gathers information on all the elements
there, which it then uses to build a representation of the page. In other words, it does not actually take a
screenshot of the page, but builds a representation of it based on the properties it reads from the DOM.
2017-12-10 11:43:34 +03:00
2017-12-07 18:49:40 +03:00
As a result, it is only able to render correctly properties that it understands, meaning there are many
CSS properties which do not work. For a full list of supported CSS properties, check out the
2017-12-10 11:43:34 +03:00
[supported features](/features/) page.
2017-12-07 18:49:40 +03:00
2017-12-10 11:43:34 +03:00
## Limitations
2017-12-07 18:49:40 +03:00
All the images that the script uses need to reside under the [same origin](http://en.wikipedia.org/wiki/Same_origin_policy)
for it to be able to read them without the assistance of a [proxy](/proxy/). Similarly, if you have other `canvas`
elements on the page, which have been tainted with cross-origin content, they will become dirty and no longer readable by html2canvas.
The script doesn't render plugin content such as Flash or Java applets.
2017-12-10 11:43:34 +03:00
## Browser compatibility
2017-12-07 18:49:40 +03:00
The library should work fine on the following browsers (with `Promise` polyfill):
- Firefox 3.5+
- Google Chrome
- Opera 12+
- IE9+
- Edge
- Safari 6+