[I have sent this message 19 hours ago. As it hasn't showed up, I try it
again.]

Paulo,
I just discovered that the trouble with fitsPage(table) relates to the
fact that this method uses a calculation that is different from the one
that is used when adding the table via document.add(table). I found out
that when I delete 4 (!) of the last rows then the table is added
properly (on the current page):

PdfPTable table = new PdfPTable(1);
do {
//add a row...
} while (writer.fitsPage(table));
table.deleteLastRow(); // deleting only this row should work fine, but
it doesn't
table.deleteLastRow(); // 3 more delete's are needed
table.deleteLastRow();
table.deleteLastRow();
document.add(table); // now table is added properly on the current page

Unfortunately this means that it's impossible to use a logic like this
to add rows dynamically dependent on the individual space that is
available and the individual heights of the rows.

Do you have an idea how to synchronize the two different calculations
that are  being used in writer.fitsPage() and document.add() ? If this
is not resolvable conveniently, what else solution would you suggest in
order to dynamically add rows until the space is over?

Thanks,
Marc



-------------------------------------------------------
This SF.net email is sponsored by: VM Ware
With VMware you can run multiple operating systems on a single machine.
WITHOUT REBOOTING! Mix Linux / Windows / Novell virtual machines
at the same time. Free trial click here:http://www.vmware.com/wl/offer/358/0
_______________________________________________
iText-questions mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/itext-questions

Reply via email to