  | Mailing List | | Home | | Forum Home | | JBoss - Java Application Server | | Tomcat - JSP/Servlet container | | Struts - A MVC web framework | | iText - An open source PDF Java Library | | JDOM - JDOM XML Parser | | J2EE - A mailing list for Java(tm) 2 Platform, Enterprise Edition | | J2EE Pattern - An interest list for Sun Java Center J2EE Pattern Catalog | | JSP - A mailing list about Java Server Pages specification and reference | | Servlet - A mailing list for discussion about Sun Microsystem's Java Servlet API Technology | |
Struts & Hibernate
|
|
|
  | | | PdfPTable.setKeepTogether(true) | PdfPTable.setKeepTogether(true) 2006-09-01 - By itext.gd@(protected)
Back Hi,
I wrote a small app to check the behaviour of iText when you add a PdfPTable to a document via document.add() on which setKeepTogether(true); is set.
These are my experiences:
I add a first table of 60 rows. (So the last row is in the upper half of the 2nd page) Then - when I add a 2nd table containing 15 rows, it fits on the rest of the 2nd page, so it is placed there. In fact a 2nd table of 33 rows still fits on the 2nd page. So - when I add a 2nd table containing 34 rows, it starts on the 3rd page. Which is due to the setKeepTogether(true)
Now here's the point I have my doubts about: - When I add a 2nd table containing 60 rows, it also starts on the 3rd page. I wonder why a new page is taken - if the table does not fit on one page - and so will be split further on?
The result is: page 1: completely filled (1st table) page 2: less than half filled (last part of 1st table) page 3: completely filled (2nd table) page 4: less than half filled (last part of 2nd table)
Since I didn't program any document.newPage() I would have expected the less paper consuming: page 1: completely filled (1st table) page 2: completely filled (last part of 1st table + first part of 2nd table) page 3: (almost) completely filled (last part of 2nd table)
I know that I can get this result by not applying setKeepTogether(true) on the 2nd table, but how can I know that I shouldn't? How can I know that the 2nd table doesn't fit on one page? (according to the methods used by document.add(table))
Kind regards, Geert
-- http://www.fastmail.fm - The professional email service
-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ----- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 __ ____ ____ ____ ____ ____ ____ ____ ____ ____ iText-questions mailing list iText-questions@(protected) https://lists.sourceforge.net/lists/listinfo/itext-questions
|
|
 |