Hello,
Is it possible to insert a SVG file with parameters in a document ?
I tried the syntax pathtosvg?param1=value1 as url in the image property but it does not work.
Inserting SVG with parameters
Inserting SVG with parameters
OpenOffice 4.1.1 on Windows XP
Re: Inserting SVG with parameters
Which software is supposed to interprete these parameters? Where are your parameters specified?
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
Re: Inserting SVG with parameters
The parameters are specified in the SVG file, as described at http://www.w3.org/TR/SVGParamPrimer/. They allow to customize the SVG (for instance the color).
An example of a SVG file named button.svg accepting 2 parameters :
To pass 2 parameters color and outline to button.svg the HTML syntax is :
This syntax is unterstood by most of browsers.
An example of a SVG file named button.svg accepting 2 parameters :
Code: Select all
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 110 40" width="100%" height="100%">
<title>Button</title>
<defs>
<ref id="paramFill" param="color" default="blue"/>
<ref id="paramStroke" param="outline" default="navy"/>
</defs>
<g>
<rect id="button_rect" x="5" y="5" width="100" height="30" rx="15" ry="15" fill="url(#paramFill)" stroke="url(#paramStroke)" />
</g>
</svg>
Code: Select all
<object type="image/svg+xml" data="button.svg?color=red&outline=black"> </object>
OpenOffice 4.1.1 on Windows XP
Re: Inserting SVG with parameters
But this is an office suite and not a browser. For anything related to foreign file formats I would prefer LibreOffice over OpenOffice.
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice