Html2canvas - Webpages Screenshots with JavaScript
html2canvas.hertzen.com
html2canvas.hertzen.com
This is truly inspiring.
I'm interested to look through the source and see how this was implemented. There are many things that are really tricky to handle using the computedStyle way of rendering HTML. Just to name a few:
* Form elements
* Dotted, dashed, rounded borders
* Gradients
* Text with word-wrap: break-word applied (for some reason measuring each character does not work properly here).
* CSS Outlines can be tricky, though I have gotten that to work pretty well in my implementation using getClientRects().
* Overflows / scrolls with fixed width or height divs (and nested ones)
* Iframes
For basic text and images (such as http://bgrins.github.com/DrawWindow/tests/basic.html) it holds up pretty well.
For IE<9 the Flash option won't have to be the only option either, a server could be rendering the elements gathered from the users browser (in other words a canvas proxy for the canvas renderer).
In terms of my script, the aim is to try and get the compatibility down to FF3, IE6 (with non-canvas support through flashcanvas or server canvas), Opera (haven't looked much yet how old version would be able to support it), and Chrome.
I threw together a hybrid of client side DOM and url2png's distributed webpage rendering farm. This proof of concept should be enough to kickstart a team needing this functionality today. Best of both worlds in my (biased) opinion.
For the HTML, it just checks a simple charset check and does the same as for images.
There are plenty of examples of the script embedded on the page though, and you can always download a copy from github and try it on your own page meanwhile.
I'm working on a browsers addon to help with remote support, mostly my mom. Thought about VNC or the like, but that's a bit of an over kill when I can just run JS in the browser.
This works great in letting me see wth she is talking about when some website is broken. This is my play ground for it, bragcollege.com. If you want to log in and play around let me know.
Is the size of the image adjustable? I'm developing an online text editor and this would be a great tool to display some kind of "page preview".
http://stackoverflow.com/questions/4912092/using-html5-canva...
http://stackoverflow.com/questions/4912092/using-html5-canva...
Also modifying the DOM preserves when hitting Send Feedback.
Kevin Rose was right, if someone can build that as a service, they would do quite well.
page.render(path_to_output);
I think it can save in PDF, GIF and PNG formats (it checks the extension on the filename to determine format)