html2canvas($('#content'), {
onrendered: function(canvas) {
var dataURL = canvas.toDataURL();
var posting = $.post(BASE + '/profiles/' + site_id + '/send-report-emails', {
emails: emails,
message: message,
data_uri: dataURL
});
posting.done(function() {
$('#emailReport input').each(function() {
$(this).val('');
});
$('#emailReport .alert').removeClass('hide');
$('#emailReport .alert strong').text('Emails sent');
});
}
});
$path = '/path/to/directory/to/save/png';
$uri = 'some-data-uri-generated-from-js';
$uriPhp = 'data://' . substr($uri, 5);
$binary = file_get_contents($uriPhp);
file_put_contents($path, $binary);