I\'m trying to create some thumbnails of dynamically created pages for a website, i have found a solution by adding the html in a svg which I then draw on an image inside a canv
Basically the solution was to put the mime type(data:image/svg+xml) in the variable containing the svg, this way you don't need to use the blob anymore and then to set the img src with the svg before drawing it to the canvas.
var canvas = document.getElementById('canvasTest'),
context = canvas.getContext('2d');
var data = "data:image/svg+xml,"+""
;
var img = new Image();
img.src = data;
img.onload = function() {
context.drawImage(img, 100, 100);
};
context.translate(canvas.width / 2, canvas.height / 2);
context.scale(0.4, 0.4);