Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Export or capture div with canvas and svg

I have an application which renders html5, canvas, and SVG in one page. My problem is I am unable to export or capture canvas objects using SVG, although I am able to do it with dataURL property.

I have tried using Html2Canvas but even this can export only canvas. It is not converting svg to canvas or exporting canvas. I have searched in our forum, but none of the answers are solving the issue.

like image 689
Pavan Kumar J Avatar asked Nov 10 '22 11:11

Pavan Kumar J


1 Answers

i saw on github this :GitHub issue for html2canvas it says : The problem is that any SVG image taints the canvas, making it unreadable. By default, html2canvas ignores content which taints the image, as we want to keep the canvas readable (i.e. for example if you want to use toDataUrl).

If however, you don't care that SVG images taint the canvas, then you can set the option allowTaint to true and SVG's should render correctly for browsers that allow inline SVG.

i don't know if it's help

like image 122
Greco Jonathan Avatar answered Nov 15 '22 08:11

Greco Jonathan