you can use a javascript library html2canvas that worked great for me in one of my projects. Here is a sample to use.
html2canvas(document.body, {
onrendered: function(canvas) {
/* canvas is the actual canvas element,
to append it to the page call for example
document.body.appendChild( canvas );
*/
}
});
A working demo here.
Good Luck with this one.