I have some nice graphics done using Raphaël (a JavaScript library), and I want to add a feature to save it as a PNG file.
This is simple on every browser except Internet Explorer, because on non-Internet Explorer browsers I get SVG as an output from Raphaël, and then I can convert it to canvas (using cansvg library) and canvas has a toDataURL()
method. But on Internet Explorer, Raphaël outputs VML. I can't use the Chrome frame plugin. Why?
Users of my application choose Internet Explorer just because it is preinstalled on Windows, and they don't have permission to install anything else. So they can't install this plugin. So my second idea was to get an SVG string on Internet Explorer, pass it to cansvg to get a canvas and then use flashCanvas
.
I tried to trick Raphaël to think it's running on a non-Internet Explorer browser and get SVG as output, but I failed, as Raphaël use some JavaScript functions that are absent in Internet Explorer to produce SVG.
So how do I accomplish this task under Internet Explorer?