How to take a screenshot of a webpage using javascript

I need to capture the currently active webpage as a screenshot. I already tried html2canvas and GrabzIt, but the problem is that I need an exact screenshot of the page I'm on now. The reason I donโ€™t want to use html2canvas is because it doesnโ€™t always return a good version of the screenshot (and not correctly), and I donโ€™t want to use GrabzIt because it is not free.

Do any of you have an idea how to do this using javascript / java / flash? Any option will work as long as it works ...

PS I am now taking screenshots with my Firefox add-on using the function that firefox offers: context.drawWindow, and now I want to make it available on the Internet.

Thank you so much!

+7
javascript html5 canvas screenshot
source share
2 answers

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

+1
source share

Possible alternatives:

rasterizeHTML.js:

this tool looks like to catch a page containing a complex html structure and image, as well as in this demo: http://cburgmer.imtqy.com/rasterizeHTML.js/

Animated 3D:

You can also find a demo on the toolโ€™s website, and it is still maintained and developed.

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

HTML2Canvas:

Or after all HTML2Canvas, because it doesnโ€™t look like it has been put on hold, quite the contrary, there is a new release version. And since I used it, it could handle image images on canvas better.

http://html2canvas.hertzen.com/examples.html

Old-Answer: I used this package in one of my projects, and it worked very well. The only complaint I have to make on this package is that the images do not display so well in the last screenshot. But maybe it has improved since then.

+7
source share

All Articles