Closed kwladyka closed 7 years ago
Just ask the paragraph for its width/height. You can constrain the width using setMaxWidth(), which will lead to a text layout. Then ask for the resulting height. If it does not fit your needs, you have to use a smaller font size. If the paragraph fits your needs, add it to the document.
Is that what you want?
Please let me know, if this fulfills your needs, so I may close the issue.
No feedback in half a year, so will close this issue. Sorry.
I have to fit text into precise width, height.
For example i have to write on PDF "foo bar baz foo bar baz foo bar baz foo bar baz ..." in XxY. If it doesn't fit i have to decrease font-size as long as it will start fit. How can i do it? How to check how much space parahraph will consume on the page?