I have tried to convert my webpage to image.
First i tried using html2canvas JS, but it doesnt support my dropdowns
html2canvas(document.body, { onrendered: function(canvas) { document.body.appendChild(canvas); } });
- Then i referred this link: https://developer.mozilla.org/en-US/docs/Web/API/Canvas_API/Drawing_DOM_objects_into_a_canvas
Now I'm little bit confused because is it possible to replace the html of my web page with my styles.
var data = '<svg xmlns="http://www.w3.org/2000/svg" width="200" height="200">' +
'<foreignObject width="100%" height="100%">' +
'<div xmlns="http://www.w3.org/1999/xhtml" style="font-size:40px">' +
'<em>I</em> like ' +
'<span style="color:white; text-shadow:0 0 2px blue;">' +
'<select><option>1</option><option>1</option><option>1</option><option>1</option></select>'+
'cheese</span>' +
'</div>' +
'</foreignObject>' +
'</svg>';
how to parse my web page html to create a svg image like this..