A way to disable style, width and heigth attributes in SVG exported xml (to allow auto-scaling in browsers)

0 votes
asked Mar 1 in Closed feature request by boshka (2,770 points)
recategorized Mar 21 by Anthony-Gaudino
Could you please support a plantuml option (a parameter passed to jar) that would disable the following attributes in the output svg file:

1. style="width:937px;height:1425px;"

2. height="1425px"

3. width="937px"

?

This will allow auto scaling (such as fit to page size) when the svg is rendered by a browser.

Here are the elements:

<?xml version="1.0" encoding="UTF-8" standalone="no"?><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" contentScriptType="application/ecmascript" contentStyleType="text/css" height="1425px" preserveAspectRatio="none" style="width:937px;height:1425px;" version="1.1" viewBox="0 0 937 1425" width="937px" zoomAndPan="magnify">
commented Mar 2 by boshka (2,770 points)
in fact these attributes can be overriden by the CSS style in browser:
svg {
    width: unset !important;
    height: unset !important;
}
But, might be, this is not always convenient to do this via the override.

1 Answer

0 votes
answered Mar 2 by plantuml (179,620 points)
selected Mar 21 by Anthony-Gaudino
 
Best answer

With last beta http://beta.plantuml.net/plantuml.jar you can have:

@startuml
skinparam svgDimensionStyle false

component a {
}
component b {
}
a -(0- b
@enduml

If you have a better idea for the parameter name, please post your suggestion here!

Is this what you are looking for ?

...