Welcome to PlantUML Q&A, where you can ask questions and receive answers from other members of the community.

You can also submit new features request and vote for them.

Is the PNG output size limited to 4096 pixels only?

0 votes

I have a large activity diagram, which grew more than 4096 pixels tall. I noticed first that the bottom of the diagram was missing. This can be fixed by using the scale command, which allows the whole diagram to fit nicely to the size given. Unfortunately the fonts and diagram elements start to get unclear (pixelated) when the diagram gets very large.

I tried to use a number which is bigger than 4096 in the scale command limits, but the output was clipped to 4096 picels high.

My version is: PlantUML version 8034 (Sat Jan 09 12:07:59 EET 2016)

Regards, Ville
asked Feb 2, 2016 by anonymous

1 Answer

0 votes

Yes, there is a limit at 4096 pixels, to avoid memory issues.

We can provide a setting that would allow to increase this limit.

Can you tell us how you are using PlantUML ? Command line ? Ant task ? Plugin in ?

answered Feb 2, 2016 by plantuml (125,210 points)
I'm using PlantUML from the command line and from the Eclipse plugin. I guess the best option would be to allow setting the image area larger than the current maximum via the "scale" and "scale max" commands which specify the sizes as pixels.

Another useful extension would be to allow setting just one of the dimensions to a maximum value, e.g. "scale max 5000 height ", which would allow just the height size to exceed the default limit. Currently it is not possible to set the max size for just one dimension.

Perhaps, another viable option would be to implement a pragma for increasing the size limit.
Regards, Ville
Ok, in the last beta https://dl.dropboxusercontent.com/u/13064071/plantuml.jar
You can have :

scale max 50 height
class Foo1
class Foo2

There is an additional setting: you can define a environment variable PLANTUML_LIMIT_SIZE (which default value is 4096).
You have to define this env variable before launching PlantUML.
Something like:

Another way is an option in the command line:
java -DPLANTUML_LIMIT_SIZE=70 -jar c:/ant/lib/plantuml.jar -v foo1.txt

This has not been highly tested, so feedback is welcome.
This seemed to work nicely at least using the environment variable method. Also the new scal syntax seems to work based on the very limited tests I have done.

Thanks a lot for the very quick response.

Regards, Ville

Is this feature implemented in the last plantuml.war ?
Yes it should.
Note that you have to set up the variable *before* launching your web server.
Support This Project Offer 250 Mo! Follow PlantUML on Twitter