exupero / saveSvgAsPng

Save SVGs as PNGs from the browser.
MIT License
1.09k stars 362 forks source link

Custom tags were not displayed in the result .png #225

Closed liuqiyuan closed 4 years ago

liuqiyuan commented 4 years ago

First of all, this is a great library which is very easy to use!

I found the <line> tags inside my svg were not displayed in the final exported png file, the nodes <circle> were displayed correctly though. What were the potential reasons? Also, the fonts seem messed up as well.

The <line> tag examples which were not displayed are as below: Screen Shot 2019-07-23 at 10 02 59 PM

And the final .png did not contain these tags: network d3

exupero commented 4 years ago

Looks like some styles aren't being inlined. Try adding a stroke attribute to the lines, and specifying the font characteristics on the text objects.

liuqiyuan commented 4 years ago

put styles inline worked. Thanks.