I have an SVG file that references lots of other, smaller, SVGs as sub images. Effectively, the main SVG is the template that positions all the other ones.
I'd like to create a single image that I can pass on to people - i.e. a data ref or just inline inclusion - but running the inkscape Embed Images
extension results in the error "images are not of type PNG, JPEG, etc".
So it sounds like the inkscape (v0.48.5) extension can only intern bitmap images, not SVGs. Bummer.
My images are referenced from the master SVG like this
<image id="PGDOWN_R1" x="1436.5" y="280" xlink:href="./symbols/PGDOWN_R3.svg"/>
So how can I automatically intern/embed all my externally referenced SVGs? (non-inkscape CLI options are welcome too)
Much like the img element in HTML SVG has an image element to serve the same purpose. You can use it to embed arbitrary raster (and vector) images. The specification requests applications to support at least PNG, JPEG and SVG format files.
The SVG format allows for the nesting of SVG graphics. It is possible for an “<svg>” elements, to be placed within another “<svg>” element. Though, within a nesting, the absolute placement is limited to the respective parent “<svg>” element.
SVG images can be written directly into the HTML document using the <svg> </svg> tag. To do this, open the SVG image in VS code or your preferred IDE, copy the code, and paste it inside the <body> element in your HTML document. If you did everything correctly, your webpage should look exactly like the demo below.
You can embed SVG elements directly into your HTML pages.
At least as of Inkscape 0.91 you can do this through this menu:
Extensions
→ Images
→ Embed Images
Quite easily! 🎉
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With