Scalable Vector Graphics

SVG is a graphical format which is scalable. It means that when you zoom an image, you don't lose quality. So this format gives good printing result.

You can enable SVG generation by using -tsvg flag with the command line.

You can also use format="svg" in the Ant task definition.

<target name="main">
  <plantuml dir="./src" format="svg" />

You can also generate SVG directly from Java.

Specific SkinParameter for SVG


You can change the target value in the generated SVG with the svgLinkTarget setting.

According to the HTML specification, you can choose:

skinparam svgLinkTarget _parent


There is also a setting skinparam pathHoverColor to specify a color change when the mouse pointer goes hover some links.

skinparam pathHoverColor green
class Foo2 [[]] {
  +double[] x
  +double y
Foo2 --> Foo3

[Ref. QA-5453]


If you does not want to have the attribut style, width and height on the header of the SVG output, you can set skinparam svgDimensionStyle false.

skinparam svgDimensionStyle false

component a {
component b {
a -(0- b

[Ref. QA-7334]

Specific Pragma for SVG


This directive !pragma svgSize <U+hhhhh> XX tells to PlantUML: "assume that the size of <U+hhhhh> is the same as 'XX' "

You can play with this directive:

to find the best setting.

🎉 Copied!

!pragma svgSize <U+1F610> XX

test: text <U+1F610>
test_size45: text <size:45><U+1F610>

You can use the -P command-line option to specify the pragma.

java -jar plantuml.jar "-PsvgSize=<U+1F610> XX" "-PsvgSize=<U+1F611> I"

[Refs. QA-12550, issue-582]

Privacy Policy      Advertise