Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!

SVGs to SVG sprite

meetdilip

Well-Known Coder
I am not sure where to ask. Please bear with me. I have a few SVG files, I want to create an SVG sprite out of it so that I can use it inside Inkscape ( Illustrator alternative ) as " Symbols ". Normally if the number is low, I can add it manually. But when there are a couple of hundred files, it needs some script to do that. Any tips on this will be great.
 
You can do it in PHP or other server side scripting technology. There, you can compose a loop in which you insert separate files and consider them as one stand-alone big file.

But each SVG-s has its heading tag you may want to remove when joining them, and place just one heading tag at the top of all images. XML parsers can help you with this, and I'm sure there are PHP libraries for XML support.

On the other side, you may want to read of embedding SVG inside SVG to avoid all the XML parsers mess. I'm not sure how this behaves regarding to the fact that there would be accompanied SVG-s to the main one. Here, you can also do the main SVG with PHP or something similar.
 
Last edited:
Back
Top Bottom