Im converting a d3 svg object with use of canvg library to an canvas and display it as an image (png).
The resulting image has a transparent background, which is not
I have ran in to this before. As you know the CSS doesn't pass get put in the DOM, so it's not read by the conversion. So you have to do inline styling instead. But the way you are currently doing it is incorrect.
So instead of using :
.attr("style","background: white;").
You have to set the style like this :
.style('fill', 'white');
That should work fine :)