Want to get an image (JPEG) from $html variable in PHP.
Steps:
- Transform my code to a canvas in HTML5
- Transform my canvas in image.
I know the steps but I do not know how to code them.
I do not want to use wkhtmltopdf.
Thanks for your help.
PS: Saw that (Website screenshots using PHP) but it's not in HTML5.
--
EDIT: Try to use this but do not work...
var c=document.getElementById("myCanvas");
var ctx=c.getContext("2d");
var img=document.body;
ctx.drawImage(img,10,10);