Skip to content

Instantly share code, notes, and snippets.

@martinop
Created July 11, 2015 19:50
Show Gist options
  • Save martinop/cc20969f49b2bb116617 to your computer and use it in GitHub Desktop.
Save martinop/cc20969f49b2bb116617 to your computer and use it in GitHub Desktop.
<html>
<head>
<script src="http://html2canvas.hertzen.com/build/html2canvas.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
<link href='http://fonts.googleapis.com/css?family=Chewy' rel='stylesheet' type='text/css'>
<link href='http://fonts.googleapis.com/css?family=Oswald' rel='stylesheet' type='text/css'>
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>
<div class ="container">
<h1 class="fuente text-center">prueba</h1>
<div class="col-md-1 col-md-offset-3">
<div id="testdiv">
<img src="post.jpg" class="img">
<img src="equipos/prueba.png" class="imgequipo">
<h2>prueba2</h2>
</div><br>
<button id="load" class="btn btn-info">Generar Imagen</button>
</div>
</div>
<script>
$(window).load(function(){
$('#load').click(function(){
html2canvas($('#testdiv'), {
onrendered: function (canvas) {
var img = canvas.toDataURL("image/png")
window.open(img);
}
});
});
});
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment