Print-out of a html5 canvas?

前端 未结 2 1848
-上瘾入骨i
-上瘾入骨i 2020-12-06 11:39

I have created a simple html-based web-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 p

2条回答
  •  长情又很酷
    2020-12-06 12:43

    You need to use the .toDataURL() method to convert the canvas to an image, which you could place on top of the canvas itself for example, prior to printing. Maybe make a print button on the page, which does that stuff, then prints etc...

提交回复
热议问题