I have a Frame and use a BlockComposer to write multiple lines of text into the Frame. The text of the lines is determined by user input so I don't know in advance how many characters they will contain.
How can I know if all of the lines will fit into the frame or if they would overflow the height of the frame?
The example below is written in Scala which uses pdfclown java:
var frame = new Rectangle2D.Double(
0, 0,
availableWidth,
availableHeight
)
for (line <- lines) {
blockComposer.begin(frame,XAlignmentEnum.Center,YAlignmentEnum.Top)
blockComposer.showText(line)
blockComposer.showBreak()
blockComposer.end()
}