Chris Dole wrote:

A first attempt would be to note that a heading is "getting close to the bottom of a 
page" and simply break the page. I'm sure this would be a bit crude, but perhaps 
preferable to orphaned headings.
That's the first example in chapter 7 (Constructing Columns) ;-)
I use method getVerticalPosition to know the Y position and
I then decide to go to a new page or not.
As you clearly indicate: it's a first attempt.

Would it help to not which things ended up on which pages, and if a redo has to 
happen, would I need to clear the entire page and redo the parts I know fit 
there? Or can you go back and just remove a couple of bits?

Then I move on explaining that you can add objects (paragraphs,
tables,...) to a ColumnText object and then pretend to add this
content to the document.
This *simulation* gives you all kinds of information: a.o. the number
of lines that was added, if the content fits the page, and so on...
Then you reconstruct the ColumnText object and decide if
you want to add it on the current or the next page.

I use this solution to avoid widows/orphans.
br,
Bruno


-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions

Reply via email to