I have a html5 canvas (3000px x 3000px). I am using the following function to print the canvas:
function printCanvas()
{
popup = window.open();
popup.document.write("<br> <img src='"+canvas.toDataURL('png')+"'/>");
popup.print();
}
The problem is, if I have only element on the canvas (say a circle) and press print, it will attempt to print out the entire canvas (3000 x 3000). Is there a way to change it so it only prints a certain section of the canvas or just the part where there are elements and not print out white space.
Thanks.