Linking SVG files via File->Import
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Inkscape |
Confirmed
|
Wishlist
|
Unassigned | ||
Bug Description
After some reading of the SVG reference document on W3C, I realised that
the <image> element allows the inclusion of entire files in the SVG
format.
When I currently click on File->Import and choose an SVG file, it is
embedded in the current file. However, it would be great to have the choice
to link to the file via an <image> tag instead as it is done when importing
a bitmap file.
Rational: Cloning objects only works within one SVG file, not across files.
Linking SVG files via <image> tags allows to include the same object in
several independent SVG files. Assume the object is a logo on a larger set
of slides (several SVG files). If the logo changes, it only needs to be
changed in the original SVG logo file. All slides are updated
automatically, because they only link to the SVG file with the logo. No
need to go over all slides.
It basically allows to build libraries of objects, which can be included in
several SVG files and still be updated without having to copy the new
version into all other SVG files.
The logic to do this is already in inkscape and it can be done with a
simple trick via the XML editor. Create a "common.svg" file as a normal
inkscape SVG file. Then create another inkscape file "drawing1.svg". If
importing the first one, inkscape will not create an <image> element, but
will parse the file and include the tags found in "common.svg". But
exporting "common.svg" at 90 DPI as a PNG bitmap and then importing this
into "drawing1.svg" will create an <image> tag. So do that first and then
use the XML editor to change the file name reference in the <image> tag
from "common.png" to "common.svg". That's it.
One thing I noticed is that the file referenced in the <image> tag must be
an uncompressed SVG. If it is a compressed .svgz file I get an error that
the target file hasn't been found. The SVG standard only mentions SVG files
as the target for an <image> tag. It is not clear to me, if this means only
uncompressed files are allowed or if compressed ones should work too.
Another thing I noticed. If I update "common.svg", I have to close and open
"drawing1.svg" to see the change. It would be great to have a "reload"
button in inkscape to re-render the SVG, triggering a re-read of the
included <image> files.
And finally, it appears as if the linked SVG file gets pixelated at some
stage of the rendering process. I would guess that the inkscape <image> tag
implementation always converts the included file to a fixed DPI bitmap
internally before displaying it. It should distinguish between bitmaps and
SVG files and render the later at screen resolution and current zoom
factor.
Changed in inkscape: | |
importance: | Undecided → Wishlist |
status: | New → Confirmed |
Originator: NO
I'd like to second this request, as noted in the inkscape-user mailing sourceforge. net/mailarchive /forum. php?thread_ name=BAY116- W225BA0509E447A 6C887D2DA6310% 40phx.gbl& forum_name= inkscape- user>
list, message:
<http://
Thanks for the great work!