Please allow to specify a filename after @startuml and set the extension automatically

0 votes
asked Feb 10, 2017 in Closed feature request by anonymous

I'd like to write:

@startuml filename

and e.g. the parameter "-pdf" should lead to filename.pdf
while the parameter "-tpng" should lead to filename.png

commented Sep 8, 2018 by Nick Nicholas
Kindly update the PlantUML Language Reference Guide to document this behaviour. I have just been caught unawares by it. :-(

2 Answers

0 votes
answered Feb 10, 2017 by plantuml (257,900 points)
selected Mar 23, 2018 by Anthony-Gaudino
Best answer
Good suggestion, thanks!

So we've built a new beta

With this beta, if no file extension if given after the "@startuml filename", we add the corresponding one.

The only drawback to us is that it breaks somehow the compatibility. someone uses PlantUML today with "@startuml filename" without extension, he will have a slightly different result (because some extension will be added to the filename). However, since we do NOT append an extension if some is already present, we expected that this will impact very few people, because probably people are putting extension to filename.

Tell us if it's working for you!
commented Oct 24, 2019 by divinitas

I use preprocessor to hide parts of a diagram e.g. 

!$internal = "yes"

!if ($internal == "yes")

bob -> alice : internal message 


so I have parts for internal documentaion only.

Depending on this I want to change the file name but with current implementation it seems to be impossible .

0 votes
answered Feb 10, 2017 by Serge Wenger Work (14,160 points)


The "filename" of the file with the PalntUML code give the "filename".

If version.txt content is:

java -jar C:\PgmFiles\PlantUML\plantuml.jar -tpng version.txt 
generate version.png
java -jar C:\PgmFiles\PlantUML\plantuml.jar -tsvg version.txt
generate version.svg