Set max width without constraining height

+1 vote
asked Feb 1, 2017 in Wanted features by anonymous
 

I have a plantUml diagram that looks like this:

enter image description here

The image has a width of 1234px and a height of 970px. I need to print the image as part of a report and would like to fit it on a letter sized sheet of paper in portrait orientation.

If I could set the max width of 900px it would fit better in my report. I don't mind if the diagram becomes significantly longer/taller.

I have tried using various combinations of

scale 200 width
scale 700 height

But as per the doc, this doesn't do what I want:

You can use the scale command to zoom the generated image.

You can use either a number or a fraction to define the scale factor. You can also specify either width or height (in pixel). And you can also give both width and height : the image is scaled to fit inside the specified dimension.

How can I set a max width for my diagram, without changing the font sizes used or constraining the height allowed for my diagram.

Cross posted this question to stackoverflow, but got very little info there.  Link: http://stackoverflow.com/questions/41126177/plantuml-set-max-width-without-constraining-height

 

1 Answer

0 votes
answered Feb 2, 2017 by plantuml (295,000 points)

Sorry, it's not possible to contraint the layout.
The "scale" feature will not help you, as you stated, because it's simple rescale the image (so it changes text size).

Maybe one possible option for you is to put text on several lines, so that the image is not too wide.

@startuml
component C1 [
XXXXXXXXXXXXX
YYYYYYYYYYYYY
]
@enduml


http://www.plantuml.com/plantuml/uml/SoWkIImgAStDuKhEpot8pqlDAr5mDbI8vef01boHo80hbiiXDIy5g0a0

Does it help ?

commented Feb 28, 2017 by anonymous
I'm having the same issue. Is there any plan to implement something in plantuml to support limiting the width?
commented Feb 28, 2017 by plantuml (295,000 points)
First, there is a PLANTUML_LIMIT_SIZE variable that may help you (see http://plantuml.com/faq )
Then, you can use --> arrow instead of -> : it helps reducing the width
You can also put \n in arrow text to decrease width.
Does those tips help ?
...