Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
bveeni opened this issue Oct 20, 2021 · 7 comments
Open

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

bveeni opened this issue Oct 20, 2021 · 7 comments

Comments

@bveeni
Copy link

bveeni commented Oct 20, 2021

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

@tanrich
Copy link

tanrich commented Mar 8, 2022

I have the same problem

@bveeni
Copy link
Author

bveeni commented Mar 8, 2022

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

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

Thanks

@tanrich
Copy link

tanrich commented Mar 8, 2022

Thanks

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

@bveeni
Copy link
Author

bveeni commented Mar 8, 2022

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.

@grumblerbear
Copy link

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

@mauriciabad
Copy link

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

@grumblerbear
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
4 participants