How to take a screenshot of a web page by using Javascript

Currently possible alternatives:

rasterizeHTML.js:

this tool looks to be capable to capture a while page containing sophisticated html-structure and an image as well in this demo: http://cburgmer.github.io/rasterizeHTML.js/

Lively 3D:

On the tool's website you can find a demo as well and it is still supported and developed.

http://livelygoes3d.blogspot.co.at/2011/11/rendering-html-on-canvas.html

HTML2Canvas:

Or after all HTML2Canvas because it does not look like that it is put on hold, quite the opposite there is a new release-version of it. And since I used it it might be handle rendering images onto a canvas better.

https://html2canvas.hertzen.com

Old-Answer: I used this package in one of my projects and it worked pretty well. The only complain I have to make on this package is that images are not rendered that well in the final screenshot. But may be it's improved since then.


In the end, I ended up using server side generation of screenshots with phantomjs. Found it the most reliable in my scenario and it takes pretty decent screenshots.