在.NET中将VML转换为SVG的问题 [英] Problems converting VML to SVG in .NET

查看:186
本文介绍了在.NET中将VML转换为SVG的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我遇到与这篇文章类似的问题;我正在使用RaphaelJS生成图表,但更具体地说,在我的情况下,我需要打印结果。我使用了 Inkscape的命令行实用工具(非常棒)将Raphael的SVG输出转换为PNG文件,用户可以下载和打印。



问题是,它适用于Firefox等但不适用于Internet Explorer。因为IE使用的是VML,而不是SVG,当用户来自IE时,Inkscape不会转换它。



我看过IECapt,可能已经完成了在我的场景中,文字截图是不够的,因为生成的图表通常跨度超过屏幕宽度,我需要在一个文件中全部。此外,用户可以通过单击节点等修改图表而不更改URL,因此在我的情况下实际使用IECapt将需要URL参数来复制图表的状态。



我只需要了解VML格式的这种转换,我可以擦掉这个项目!



链接




解决方案

您可以通过VML将VML转换为SVG这个: http://sourceforge.net/projects/vectorconverter/ ,取自这个问题:< a href =https://stackoverflow.com/questions/1473773/are-there-any-tools-to-convert-legacy-vml-to-s vg>是否有任何工具可以将旧版VML转换为SVG?,然后通过Inkscape运行以获取PNG版本。



编辑:vectorconverter工具是基于PHP的,但是使用XSLT来解决繁重问题 - VML和SVG只是简单的XML - 所以如果你不能直接访问PHP库,你可能会设法以你选择的语言重用XSLT。 p>

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

解决方案

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.

这篇关于在.NET中将VML转换为SVG的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆