dom-to-image icon indicating copy to clipboard operation
dom-to-image copied to clipboard

images in DOM are not converting into base64

Open Talal0 opened this issue 4 years ago • 4 comments

I'm using dom-to-image in ionic4 project it is working fine in android but in iOS is not converting showing blank space inside container

Talal0 avatar Dec 09 '20 08:12 Talal0

According to the readme, Safari is not supported:

Safari is not supported, as it uses a stricter security model on <foreignObject> tag. Suggested workaround is to use toSvg and render on the server.`

— https://github.com/tsayen/dom-to-image#browsers

I would assume this goes for both MacOS and iOS

csandman avatar Dec 10 '20 20:12 csandman

Solved this issue by translate the network image into base64 by canvas.toDataURL before using dom-to-image on safari

Ginhing avatar Jan 13 '21 05:01 Ginhing

@Ginhing can you show example i have same problem for image it already base64 but still showing blank space

nattapat-cop avatar Jan 18 '21 04:01 nattapat-cop

Had the same issue on Safari. Used SVG instead of png and the issue was solved.

jijojosein avatar Jul 07 '23 14:07 jijojosein