
Reuse model elements in various diagrams to achieve consistency: for instance, you could define a complete class model of your application in classes.iuml and then produce several different diagrams which only include subparts of classes.iuml, or hides specific classes, attributes or methods (see sections “Hide attributes, methods” and “Hide classes” in the class diagram docs). Format the diagram to match a specific purpose or output medium: for instance, you could define your elements in mydiagram.puml and create another optimized-for-16-by-9.puml file which !includes mydiagram.puml, followed by various layout tricks (as presented in my previous article) to produce a diagram that fits on a 16:9 screen. Use the same styling for all your diagrams: you can declare a common-styles.iuml file that defines various styling aspects (see my previous article), to achieve visual consistency across all your diagrams.
Applying !include to your own files is a very useful mechanism for different use cases, such as: I highly recommend reading the official docs, in particular the sections “Including files or URL” and “Including Subpart”. The !include command is actually a PlantUML preprocessor command, which also supports including only specific sections of the included file. In the introduction article I introduced the !include command, which you can use to load other files, such as standard library sprites.
With the tag, links are not clickable! To see how you can influence the link target and hover color, take a look at the docs explaining the SVG-specific skinparam options. If you want to embed a SVG diagram file into HTML-based documentation, and your diagram contains clickable URLs, do not use to embed the image, but. Your web browser will be able to navigate even large SVG files without problems. In all other cases, I recommend to export SVG.here for a discussion of different approaches.
Libreoffice uml pdf#
If you need an automated solution, search the Internet for CLI tools that let you convert / embed SVG (in) to PDF files. MS Word, LibreOffice, …), configure the page size and margins there, and scale & print the diagram without any loss in quality. If you just need to print your diagram once (or rarely), you can simply drag the SVG file into your favorite document editor (e.g. It is easier to export your diagram as SVG and then create & configure a PDF file (including page dimensions, margins, etc.) with other tools: From personal experience, rendering PDFs with PlantUML is cumbersome, especially when it comes to setting up the right aspect ratio, dimensions or margins. If you want to print the diagram, do not use PlantUML’s PDF ( -tpdf) export, but export the file as SVG ( -tsvg). If you want to use the diagram in LaTeX, use the LaTex/Tikz format ( -tlatex on the CLI). I recommend the following formats, depending on the use case: If elements of your diagram contain clickable URLs, you’d have to use PlantUML’s pipemap option ( docs) to generate image maps, and embed then into your HTML file, which is a chore!. Large diagrams (with many elements) become huge (in terms of pixel dimensions and file size), and your viewer might choke on the file.
However, PNG is almost never useful, and it has several disadvantages: If you use the CLI ( java -jar plantuml.jar /path/to/file.puml) then the default output format is PNG. PlantUML offers many different output formats. The first two sections should be of interest to everyone, while the remaining sections are only for specific audiences. This article is a random collection of advanced features you may find useful. As my introduction article explains, you can use PlantUML for any kind of UML diagram and beyond, including mind maps or Gantt charts.
PlantUML is a Java-based tool that lets you express diagrams as code.