Inkscape:SVG到PDF删除组

时间:2018-01-29 20:41:58

标签: javascript pdf svg adobe-illustrator inkscape

我使用SVG.js创建了一个SVG生成器,它创建了100多个Path元素,所有这些元素都放在6个不同的组中。使用Adobe Illustrator打开的结果SVG文件显示组正常。

但是,我在命令行中使用Inkscape(自动化过程需要)将SVG文件转换为PDF。

 inkscape --file=input.svg --export-area-drawing --without-gui --export-pdf=output.pdf

生成PDF文件时,其所有Path元素位于同一级别,没有任何类型的组/层,这对我的项目是必需的。

有没有办法让Inkscape不对这些元素进行分组?

附上最终结果的图像(左侧,SVG文件 - 右侧,转换后的PDF)

Image: SVG and PDF layers

示例SVG:

<svg width="100%" height="100%" viewBox="0 0 95 50" xmlns="http://www.w3.org/2000/svg">
<g stroke="green" fill="white" stroke-width="5">
    <circle cx="25" cy="25" r="15" />
    <circle cx="40" cy="25" r="15" />
    <circle cx="55" cy="25" r="15" />
    <circle cx="70" cy="25" r="15" />
</g>
<g stroke="red" fill="white" stroke-width="5">
    <circle cx="25" cy="25" r="15" />
    <circle cx="40" cy="25" r="15" />
    <circle cx="55" cy="25" r="15" />
    <circle cx="70" cy="25" r="15" />
</g>

0 个答案:

没有答案