On Mon, October 24, 2011 14:36, 1T3XT BVBA wrote: > On 24/10/2011 13:52, Dalui, Somak wrote: >> >> Hi, >> >> I have a situation where a PDFPTable is created iterating on a Java >> object containing all data and then it is added to the document object. >> >> Now, I have to make a page break(or create a new page) when a >> condition is met while creating the PDFPTable. >> >> If I do document.newPage(), it makes no effect. What am I missing or >> what do I need to add ? >> > > First you need to know that document.newPage() only adds a new page if > the current page isn't blank. > > Now let's look at your logic.
*snip* > It should be obvious that row 4 and 7 don't start on a new page. > You've built the table in memory. As long as you don't add the table to > the document, the document isn't aware that you're building a table. The > table isn't aware of the fact that you wanted row 4 and 7 to start on a > new page. > > As you should now understand, this is not an iText problem; this is a > case of elementary logic. In short: whenever you want to add a new page, first add everything you already have in memory on the current page. ------------------------------------------------------------------------------ The demand for IT networking professionals continues to grow, and the demand for specialized networking skills is growing even more rapidly. Take a complimentary Learning@Cisco Self-Assessment and learn about Cisco certifications, training, and career opportunities. http://p.sf.net/sfu/cisco-dev2dev _______________________________________________ iText-questions mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/itext-questions iText(R) is a registered trademark of 1T3XT BVBA. Many questions posted to this list can (and will) be answered with a reference to the iText book: http://www.itextpdf.com/book/ Please check the keywords list before you ask for examples: http://itextpdf.com/themes/keywords.php
