Examples

Christoph Burgmer edited this page Oct 22, 2018 · 7 revisions

Simply drawing some HTML

var canvas = document.getElementById("canvas"),
    html = "<span>Some HTML</span>";

rasterizeHTML.drawHTML(html, canvas);

Demo: http://jsfiddle.net/cburgmer/E8fb2/13/

Putting the HTML on the canvas ourselves

var canvas = document.getElementById("canvas"),
    context = canvas.getContext('2d'),
    html = "<span>Some more HTML</span>";

rasterizeHTML.drawHTML(html).then(function (renderResult) {
    context.drawImage(renderResult.image, 10, 25);
});

Demo: http://jsfiddle.net/cburgmer/NfE3c/166/

Clone this wiki locally
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.