<html>
<head>
<title>test</title>
<script src="external/jquery-1.6.2.js"></script>
<script type="text/javascript" src="js/html2canvas.js"></script>
<script type="text/javascript">
$(document).ready(function() {
$('body').html2canvas();
var queue = html2canvas.Parse();
var canvas = html2canvas.Renderer(queue,{elements:{length:1}});
var img = canvas.toDataURL()
window.open(img);
});
</script>
</head>
<body>
<h1>Testing</h1>
<img src='http://localhost:8080/test/images/1.jpg'>
</body>
</html>
Shouldn’t I be seeing a new window open up with this webpage as an image? What am I missing?
If you’re new to html2canvas as I am- below is some boilerplate code to get you started. Hope it helps someone else.
Note- I am using v0.34.
You can then use the toDataUrl() as a src tag in another html page (or whatever you want to do from here):