Embed SVG in SVG?

前端 未结 6 591
無奈伤痛
無奈伤痛 2020-11-27 11:00

I have an SVG document, and I would like to include an external svg image within it, i.e. something like:



        
      
      
      
6条回答
  •  野性不改
    2020-11-27 11:33

    I found that using the tag gave a low-quality render of the embedded file. However the following technique worked (to embed an SVG file inside an SVG file - not necessarily for rendering on an HTML page):

    • Edit the SVG file in a text editor.

    • Find the end of the metadata:

      
        
      
    • Insert this line after that group tag:

      
      
    • In this case we are including OTHERFILE.svg into the file, and all of layer1 (the first and default layer).

    • Save this and then open the file in Inkscape.

    This technique is useful for having a standard background or logo on every page. By putting it first in the file it will be rendered first (and thus at the bottom). You could also lock it by adding this attribute:

    sodipodi:insensitive="true" 
    

    In other words:

    
    

提交回复
热议问题