Canvas print html5?

I created a simple html page consisting of a form and some text, plus a canvas. I would like to print the page, including the canvas on a piece of paper, the problem is that the canvas will not be displayed in the printout. Is that what I missed in how to handle the canvas? I am currently using Opera, any knowledge of whether other browsers work better with this?

+7
source share
2 answers

what you need to do in this case has a special type of print, where the canvas is replaced by an image file, which is then easily printed.

see here: Capturing HTML canvas as gif / jpg / png / pdf?

+15
source

You need to use the .toDataURL () method to convert the canvas to an image that you could place on top of the canvas itself, for example, before printing. It is possible to make a print button on a page that does this, then prints, etc.

+2
source

All Articles