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
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions