On Mon, Jan 12, 2009 at 4:06 PM, Benjamin Rein <[email protected]> wrote: > > Hi Charlie, > > I think it's possible to let iText do the splitting work automatically, but > I don't know if it's the best way. > Couldn't you just call Document.newPage() after adding a complete data set > to the document? > > For doing the newPage automatically you have to add a Chunk with GenericTag > as last element of a data set. When the element with the GenericTag is added > to the document the onGenericTag method of the event class is called. There > you can do whatever should happen after adding a complete data set e.g. goto > a new page. > > GenericTag example: > http://stderr.org/doc/libitext-java-doc/www/tutorial/ch12.html
Thank you for your reply. I call Document.NewPage() at a few points in the document but I can't really call it after every dataset. As I said the average data set takes up about a third of a page so if I called that after each one it would take up 3 times more paper when its eventually printed (which it always will be). What I want to be able to do is know if it will all fit on what's left of the page then insert a new page break before it if it won't. Is this possible with iText as I will have already added the content. Can I insert the page break before the dataset elements that have already been added via document.add(...)? Charlie M ------------------------------------------------------------------------------ This SF.net email is sponsored by: SourcForge Community SourceForge wants to tell your story. http://p.sf.net/sfu/sf-spreadtheword _______________________________________________ iText-questions mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/itext-questions Buy the iText book: http://www.1t3xt.com/docs/book.php
