将多个SVG文件合并为一个 [英] Merging multiple SVG files into one

查看:390
本文介绍了将多个SVG文件合并为一个的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

首先,我知道有很多类似的问题,但似乎没有一个对我有用.我想知道是否有任何方法可以在一个文件中合并多个svg文件.像这样:

first of all I know that there are many similar questions like this, but none of them seem to do the trick for me. I'd like to know if there is any way to combine multiple svg files within one single file. Somewhat like this:

<svg id="background" ...>
   <svg id="first" ...>
       ...
   </svg>
   <svg id="second" ...>
       ...
   </svg>
   ...
</svg>

是否有某种模板或教程可以帮助我做到这一点?最后,我想使用java和javafx 2.2以编程方式进行此操作.

Is there some sort of template or tutorial that helps me do this? In the end I want to do this programmatically using java und javafx 2.2.

推荐答案

要完全以这种方式更改SVG,应检查我的SVG堆叠工具.由于SVG是XML,因此可以使用XSLT转换数据:

To change the SVG in exactly that way, you should check out my SVG Stacking Tool. As SVGs are XML one can use XSLT to transform the data:

更新:正如评论中指出的那样,似乎存在一个错误,因此需要多次请求SVG文件.可以在此处找到更多详细信息和可能的解决方案:

Update: As pointed out in the comments, there seems to be a bug so that the SVG file is requested multiple times. More details and a possible solution can be found here:

这篇关于将多个SVG文件合并为一个的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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