Problems converting VML to SVG in .NET

痴心易碎 提交于 2019-12-25 03:58:08

问题


I have a very similar problem as this post; I'm using RaphaelJS to generate a chart, but more specifically in my case I need to print the result. I have used Inkscape's command line utility (it's excellent) to convert Raphael's SVG output to a PNG file, which the user can download and print.

The problem is, it works in Firefox etc. but not Internet Explorer. Because IE uses VML, not SVG, Inkscape won't convert it when the user is coming from IE.

I have had a look at IECapt which might well have done the job, but a literal screenshot wouldn't be enough in my scenario as the generated chart normally spans more than a screen width and I need it all in one file. Also the user can modify the chart by clicking on nodes etc without changing the URL, so actually using IECapt in my case would require URL parameters to replicate the state of the chart.

I just need to get my head around this conversion from the VML format and I can wipe my feet of this project!

Links

  • Using Inkscape directly from a C# application
  • IECapt

回答1:


You can convert the VML to SVG via this: http://sourceforge.net/projects/vectorconverter/, taken from this question: Are there any tools to convert legacy VML to SVG?, then run it through Inkscape to get the PNG version.

Edit: The vectorconverter tool is PHP-based but uses XSLT for the heavy lifting - VML and SVG are just XML under the hood - so if you can't access the PHP libraries directly you could probably manage to reuse the XSLT in the language of your choice.



来源:https://stackoverflow.com/questions/5898029/problems-converting-vml-to-svg-in-net

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!