SVG for PNG save CSS using javascript

This is a bit long shot, but does anyone know a tool that can export png from svg input And keep the CSS styles applied to it. I used canvg, but everything looks black in the output since the styles are stored in css and not in the svg document.

The solution is based on the web interface, and I would like to complete the client side of the conversion using, if possible, a javascript solution.

+3
source share
2 answers

Update:

I understand that you are using an external style sheet for SVG markup. So I think you need a three-step solution:

  • , SVG. . , W3C DOM Level 2 Style , , ( document.defaultView.getComputedStyle(), , , SVG ).
  • SVG PNG. (, ImageMagick), SVG .
  • PNG .

, onsubmit # 1, submit().

+2

@pluke, @PointedEars , CSS SVG. . , , SVG, Rickshaw/D3: @thirdcreed JavaScript : Rickshaw CSS/Axes JSDOM - D3 CSS/SVG .

0

All Articles