Skip to content

Instantly share code, notes, and snippets.

Created Mar 14, 2018

What would you like to do?
#mydiv {
background-color: lightblue;
width: 200px;
height: 200px
<div id="mydiv">
<img src="/img/logo-white.png" />
<p>text hhhh!</p>
<h2 id="link"></h2>
html2canvas([document.getElementById('mydiv')], {
onrendered: function(canvas) {
var data = canvas.toDataURL('image/png');
// AJAX call to send `data` to a PHP file that creates an image from the dataURI string and saves it to a directory on the server
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.