I have seen many people struggling with this business, but I can’t find the right solution, nor the one that fits my needs.
I make several graphs with Raphael, and I basically need to get them as PNG (for export or later use some other files in a PDF file). For Firefox, Chrome, IE 9 and any other browser with SVG support easily. In fact, there are two ways to achieve it: using canvg to render the SVG into a canvas element, and then get the image data; or sending SVG to the server (C #) and using the library to rasterize it.
The problem, of course, is in IE 8 and 7. In these browsers, Raphael outputs VML, and there is no way to get the source of the SVG. I could not find the VML rasterizer, so it allows me only one solution: translate VML to SVG or redraw the document in SVG.
I checked the por PHP vector library, which actually uses XSLT transforms to translate VML to SVG, but I couldn't get it to work (I tried several XSL testing tools, but none of them work).
I tried to get Raphael to output SVG to a hidden div by changing its properties .type, .svgand .vmlcorrectly, but that didn't work either.
I think there might be a way to write an SVG tree into a hidden DIV while in IE; although the browser will not be displayed by the browser, the text should be there.
- ? !