Saving as SVG File
Posted: 2017-01-18T11:33:21-07:00
I'm using the rmagick ruby gem. Any file I try to save as a SVG throws an error when I try to open it in a application that can view SVGs
Error: Couldn't find end of Start Tag g
Raw SVG File:
Created the file following this tuturial (https://rmagick.github.io/rvgtut.html), however any file I create and save as an SVG throws this error. Looks like it's messing up the tags on line 5 of the xml.
Any help appreciated
Error: Couldn't find end of Start Tag g
Raw SVG File:
Code: Select all
<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20010904//EN"
"http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
<svg width="180" height="180">
<g style="<defs>
<clipPath id="70307562988220">
">
<g style="">
<path d="M0,0 l180.0,0 l0,180.0 l-180.0,0 l0,-180.0z"/>
</g>
</clipPath>
</defs>
clip-path:url(#70307562988220);<g style="rotate(-30.0) fill:yellow;stroke:black;stroke-width:2.0;" transform="matrix(0.72 0 0 0.72 100 150)">
<g style="" transform="matrix(0.72 0 0 0.72 100 150)">
<ellipse cx="0" cy="0" rx="50" ry="30"/>
</g>
<g style="skewX(-35.0) " transform="matrix(0.72 0 0 0.72 100 150)">
<rect x="-20" y="-10" width="45" height="20"/>
</g>
</g>
<g style="stroke:black;stroke-width:2.0;" transform="matrix(0.72 0 0 0.72 130 83)">
<g style="fill:yellow;" transform="matrix(0.72 0 0 0.72 130 83)">
<circle cx="0" cy="0" r="30"/>
</g>
<g style="fill:black;" transform="matrix(0.72 0 0 0.72 130 83)">
<circle cx="10" cy="-5" r="5"/>
</g>
<g style="fill:orange;" transform="matrix(0.72 0 0 0.72 130 83)">
<polygon points="30,0 70,5 30,10 62,25 23,20 30,0 "/>
</g>
</g>
<g style="rotate(15.0) " transform="matrix(0.72 0 0 0.72 75 188)">
<g style="" transform="matrix(0.72 0 0 0.72 75 188)">
<g style="fill:orange;stroke:black;stroke-width:2.0;" transform="matrix(0.72 0 0 0.72 75 188)">
<path d="m0,0 v30 l30,10 l5,-10, l-5,-10 l-30,10z"/>
</g>
</g>
</g>
<g style="rotate(-15.0) " transform="matrix(0.72 0 0 0.72 100 185)">
<g style="" transform="matrix(0.72 0 0 0.72 100 185)">
<g style="fill:orange;stroke:black;stroke-width:2.0;" transform="matrix(0.72 0 0 0.72 100 185)">
<path d="m0,0 v30 l30,10 l5,-10, l-5,-10 l-30,10z"/>
</g>
</g>
</g>
<g style="" transform="matrix(0.72 0 0 0.72 100 185)">
<g style="fill:black;font-family:helvetica;font-size:20;</svg>
Any help appreciated