I tried to export as an png image drawing the svg base64 image in a canvas but the drawImage function throw a "Uncaught InvalidStateError: Failed to execute 'drawImage' on 'CanvasRenderingContext2D': The HTMLImageElement provided is in the 'broken' state.(anonymous function)"
I made a img and serialize the svg to svg+xml string, and then convert it to base64. this img i pass to canvas.getContext("2d").drawImage function.
this canvas i will export with canvas.toDataUrl.
the same data:image/svg+xml;base64 open nicely in a new tab, like in http://desafio.kayran.com.br/desafio page, but the same data doesnt open im img tag and no open in canvas.
I tried to export as an png image drawing the svg base64 image in a canvas but the drawImage function throw a "Uncaught InvalidStateError: Failed to execute 'drawImage' on 'CanvasRenderingContext2D': The HTMLImageElement provided is in the 'broken' state.(anonymous function)"
I made a img and serialize the svg to svg+xml string, and then convert it to base64. this img i pass to canvas.getContext("2d").drawImage function.
this canvas i will export with canvas.toDataUrl.
the same data:image/svg+xml;base64 open nicely in a new tab, like in http://desafio.kayran.com.br/desafio page, but the same data doesnt open im img tag and no open in canvas.
how to solve this issue?