Open BMPMS opened 5 years ago
I've solved the problem by going into the code.
@tsayen Thank you for this nice library. @BMPMS I'm stuck with the same problem. I tried your modifications. The dom element for the SVG images are rendered but the images are still missing in the output. In my html page, the SVG images are used with svg tags.
@tsayen Thank you for this nice library. @BMPMS I'm stuck with the same problem. I tried your modifications. The dom element for the SVG images are rendered but the images are still missing in the output. In my HTML page, the SVG images are used as given below.
<svg xmlns:xlink>
<use xlink:href="...svg image from my resource"/>
<svg>
It worked for me. The only difference is I was using an image tag rather than a use tag. Hope that helps?
@BMPMS I tried to update your fix to support the screengrab of SVG tags with use tag as children, but I'm stuck and the inline promise (that gets dataURL as an argument) is not resolved. Can you help me with this?
I'm afraid I can't. This isn't my area really but since I managed to solve my specific problem I thought it was worth sharing.
Just to reiterate the above, I was using image tags not use tags.
@BMPMS No problem. Thanks for your contribution anyways.
@BMPMS Thanks lot man .
I had the same issue. Thanks @BMPMS !!
What is the solution for svg image tags? I got the same problem
Thanks, @BMPMS !!! Your solution worked just fine. Now the svg image is being downloaded.
@aravind14feb thanks! I resolved my problem with your solution!
You might want to look at a fork of this project that seems more maintained: https://github.com/bubkoo/html-to-image. That fork has this same bug. The bug has been fixed in https://github.com/maurodesouza/html-to-image/commit/9eaf8030f9a1056e4818a4d0f53abd90791d865a but so far the fix hasn't been released.
@jsuvanto And it won't be either as the author has not raised a PR
For me what worked was installing html-to-image and not using dom-to-image
...
I've just discovered your brilliant tool. It works perfectly apart from one issue - SVG images, such as this one:
I'm using toBlob to save the whole web page as a PNG and the svg images are not rendering: