We recently had a client writing a nice application outputting PDF with our MBS Xojo DynaPDF Plugin. You can use the WriteFText function (or WriteStyledText) to layout text over multiple boxes on multiple pages to do layouts like a newspaper or a magazine. You can continue on a different page (next one, previous one, jump 10 pages forward) and leave room to place images.
Today we have the little trick to avoid having a last line in a paragraph on the next page like in the picture above. As you see we drew a rectangle to show the area we use for WriteFText to draw the text. Since our text doesn't fit, the PageBreak event gets called and we start a new page to continue drawing there.
Recently we added the GetLastTextOffset function to ask where in the text we are for the page break. We can measure the height of the text going on the next box and just add this text as a line below the block, if it is short. This avoids the one line on the top of the next page. Here is the sample code:
Please try and let us know if you have questions. See the example "Create PDF with text block2" coming with 23.4 plugin versions.
If you like to use this, get a DynaPDF Starter (or higher) license, e.g. with OmegeBundle.