I'm using ckeditor to create email templates, I'm trying to get a thumbnail view of a given html code.
I have tried with
html2canvas(document.getElementById('templatecontent'),{
onrendered: function (canvas) {
var imgString = canvas.toDataURL("image/png");
window.open(imgString);
}});
But here id(#templatecontent) is hidden textarea element. How to save an image even if the id is hidden.
Or
Can this operation can be done directly with php if I have html code? this will be great. Please give me some suggestions or procedure to follow.
Error details: IndexSizeError: Index or size is negative or greater than the allowed amount