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

Image of svg element from DOM is not embedded in png.

Open bveeni opened this issue 3 years ago • 7 comments

Hi everyone, My DOM contains svg element-under div element, which is created using javascript. And that svg has image element,as shown in attached image(html.png). With this domtoPng, in downloaded png file, I am able to see all elements from dom, except this image of svg,(which I set it as background for graph) . When I run my app, I can see the image (i.e included in my dom) as shown in expected image.But png file, that I got by downloading using domtopng excludes that image.You can check on result.png, that shows missing image. Please let me know, if anyone comes with such issue. expected html result

Thanks Binita Shrestha

bveeni avatar Oct 20 '21 00:10 bveeni

I have the same problem

tanrich avatar Mar 08 '22 05:03 tanrich

Hey @tanrich dom-to-image.min.zip

I solved this issue using this js file. You can try using this file.

Thanks

bveeni avatar Mar 08 '22 05:03 bveeni

Thanks

I don't understand. What's the difference. Thanks.

tanrich avatar Mar 08 '22 05:03 tanrich

Somewhere I found this file and suggested to try using this one and that worked for me. I don't remember exactly what changes I made. I am not sure if this will work for you but yes, you can give a try.

bveeni avatar Mar 08 '22 05:03 bveeni

Hi! Your solution great work with fill: url(#namePattern) but not work with stroke: url(#namePattern), maybe you can add this feature, please?

grumblerbear avatar Nov 13 '22 03:11 grumblerbear

For me what worked was installing html-to-image and not using dom-to-image...

mauriciabad avatar Feb 20 '23 06:02 mauriciabad

https://root.lacony.ru/eclipse i try use html-to-image there (when click on one object) but its work bad, if dom-to-image just wrong work with svg, this lib create strange gradients

grumblerbear avatar Mar 05 '23 22:03 grumblerbear