html2canvas doesn't support Canvas.
Is this feature part of the roadmap ?
I know that SVG support is planned according to the author's Tweeter page.
Canvas images can be supported as long as they are not restricted with security settings (i.e. they can be outputted with toDataUrl).
As for SVG, I most likely won't create something just for this script, as there are perfectly fine open source scripts that do this already (convert SVG to canvas), such as canvg (http://code.google.com/p/canvg/) which could just be used with this script.
Why do I ask for a canvas support:
I use html2canvas in order to print, or save as image, rendered maps with OpenLayers, a very popular Open-Source map rendering library.
example : http://dev.openlayers.org/releases/OpenLayers-2.10/examples/
The server side functionnality works fine but it requires server components that I can't setup.
As you can see on the map, there are multiple image tiles and a SVG or Canvas (if supported) layer.
So I use html2canvas to print the map, everything works fine except the Canvas that is NOT included on the printed map.
So in your last message, did you mean that I should do a toDataURL export of the OpenLayers canvas layer(s) and merge it with the html2canvas generated canvas ?
For now, I'd recommend that.
I am in the process of rewriting a lot of the code and restructuring it (have a look under dev branch). At some point I will add support for loading canvas images straight into the canvas with (getImageData and putImageData), but until then I'd recommend keeping the canvas layers separate.
There are a lot of css attributes and elements which aren't supported so I wouldn't recommend putting this script into a production environment yet.
Hey, svg still sin't supported by html2canvas. Can we expect it to be coming soon?
As you said that svg to canvas is possible with canvg, but neither canvg nor html2canvas are helpful if my code contains both svg graphs and html elements. Is there any way i could resolve this issue? My code has both svg and html and I want to take a screenshot of it.