All Projects → niklasvh → Html2canvas

niklasvh / Html2canvas

Licence: mit
Screenshots with JavaScript

Programming Languages

javascript
184084 projects - #8 most used programming language
typescript
32286 projects
HTML
75241 projects
CSS
56736 projects

Projects that are alternatives of or similar to Html2canvas

Html To Image
✂️ Generates an image from a DOM node using HTML5 canvas and SVG.
Stars: ✭ 595 (-97.63%)
Mutual labels:  screenshot, dom
Nextcloud Notes
✎ Android client for Nextcloud Notes app.
Stars: ✭ 529 (-97.89%)
Mutual labels:  screenshot
Chromda
λ 🖼️ Chromda is an AWS Lambda function for capturing screenshots of websites.
Stars: ✭ 481 (-98.08%)
Mutual labels:  screenshot
Ashot
WebDriver Screenshot utility. Take screenshots, crop, prettify, compare
Stars: ✭ 507 (-97.98%)
Mutual labels:  screenshot
Injectablegenericcamerasystem
This is a generic camera system to be used as the base for cameras for taking screenshots within games. The main purpose of the system is to hijack the in-game 3D camera by overwriting values in its camera structure with our own values so we can control where the camera is located, it's pitch/yaw/roll values, its FoV and the camera's look vector.
Stars: ✭ 492 (-98.04%)
Mutual labels:  screenshot
React Screenshot Test
A dead simple library to screenshot test React components
Stars: ✭ 519 (-97.93%)
Mutual labels:  screenshot
Html5 Dom Document Php
A better HTML5 parser for PHP.
Stars: ✭ 477 (-98.1%)
Mutual labels:  dom
Screencloud
Screenshot sharing application for Windows, Mac and Linux.
Stars: ✭ 537 (-97.86%)
Mutual labels:  screenshot
Web Series
📚 现代 Web 开发语法基础与工程实践,涵盖 Web 开发基础、前端工程化、应用架构、性能与体验优化、混合开发、React 实践、Vue 实践、WebAssembly 等多方面。
Stars: ✭ 666 (-97.35%)
Mutual labels:  dom
Deviceframe
📱 Put device frames around your mobile/web/progressive app screenshots.
Stars: ✭ 507 (-97.98%)
Mutual labels:  screenshot
Motus
Animation library that mimics CSS keyframes when scrolling.
Stars: ✭ 502 (-98%)
Mutual labels:  dom
Url2img
HTTP server with API for capturing screenshots of websites
Stars: ✭ 495 (-98.03%)
Mutual labels:  screenshot
Saint
👁 (s)AINT is a Spyware Generator for Windows systems written in Java. [Discontinued]
Stars: ✭ 522 (-97.92%)
Mutual labels:  screenshot
Artplayer
🎨 ArtPlayer.js is a modern and full featured HTML5 video player
Stars: ✭ 484 (-98.07%)
Mutual labels:  screenshot
Grim
Grab images from a Wayland compositor
Stars: ✭ 533 (-97.88%)
Mutual labels:  screenshot
Ffcast
Run command on rectangular screen regions
Stars: ✭ 478 (-98.1%)
Mutual labels:  screenshot
Awesome
🚀A curated list of awesome resources related to Alpine.
Stars: ✭ 502 (-98%)
Mutual labels:  dom
Testing Playground
🐸 Simple and complete DOM testing playground that encourage good testing practices.
Stars: ✭ 511 (-97.97%)
Mutual labels:  dom
Imgur Screenshot
Take screenshot selection, upload to imgur. + more cool things
Stars: ✭ 540 (-97.85%)
Mutual labels:  screenshot
React Svg
🎨 A React component that injects SVG into the DOM.
Stars: ✭ 536 (-97.87%)
Mutual labels:  dom

html2canvas

Homepage | Downloads | Questions

Gitter CI NPM Downloads NPM Version

JavaScript HTML renderer

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.

How does it work?

The script renders the current page as a canvas image, by reading the DOM and the different styles applied to the elements.

It does not require any rendering from the server, as the whole image is created on the client's browser. However, as it is heavily dependent on the browser, this library is not suitable to be used in nodejs. It doesn't magically circumvent any browser content policy restrictions either, so rendering cross-origin content will require a proxy to get the content to the same origin.

The script is still in a very experimental state, so I don't recommend using it in a production environment nor start building applications with it yet, as there will be still major changes made.

Browser compatibility

The library should work fine on the following browsers (with Promise polyfill):

  • Firefox 3.5+
  • Google Chrome
  • Opera 12+
  • IE9+
  • Safari 6+

As each CSS property needs to be manually built to be supported, there are a number of properties that are not yet supported.

Usage

The html2canvas library utilizes Promises and expects them to be available in the global context. If you wish to support older browsers that do not natively support Promises, please include a polyfill such as es6-promise before including html2canvas.

To render an element with html2canvas, simply call: html2canvas(element[, options]);

The function returns a Promise containing the <canvas> element. Simply add a promise fulfillment handler to the promise using then:

html2canvas(document.body).then(function(canvas) {
    document.body.appendChild(canvas);
});

Building

You can download ready builds here.

Clone git repository:

$ git clone git://github.com/niklasvh/html2canvas.git

Install dependencies:

$ npm install

Build browser bundle

$ npm run build

Examples

For more information and examples, please visit the homepage or try the test console.

Contributing

If you wish to contribute to the project, please send the pull requests to the develop branch. Before submitting any changes, try and test that the changes work with all the support browsers. If some CSS property isn't supported or is incomplete, please create appropriate tests for it as well before submitting any code changes.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].