Hi all,
I have a problema while calculating the remaining space of the page (in
order to check if some content will fit in).
Let me explain the scenario:
I have two tables, the first one contains a title (paragraph) for the second
table, and the second one contains some content.
Both of them have the same locked width, so I'm able to get their height. I
want to ensure that at least, the first table and the first 2 rows of the
second table fit the remaining space
But the problem is that, for example, I take the writer vertical position
(which returns me for example 188), then the bottom margin (54) , and the I
do:
if ((writer.getVerticalPosition(true) - secondTable.getRowHeight(0) -
secondTable.getRowHeight(1) - firstTable.getTotalHeight) <=
document.bottom())
which allow me to decide if the sum of the first table and the first two
rows of the second one, will fit in the remaining space (vertical postion
minus bottom margin).
It tells that it will fit, as the sum "secondTable.getRowHeight(0) -
secondTable.getRowHeight(1) - firstTable.getTotalHeight" return for example
129 and the vertical postion is 188, so the difference is bigger than 54,
but when I open the pdf, the second table has jump to the next page (of
course I have the splitLate to false and so on in order to allow splitting
the second table).
It seems that there is some extra space I'm not taking care of.
Could you please help me? I could send some examples if you want
Best regards,
Aritz
------------------------------------------------------------------------------
The best possible search technologies are now affordable for all companies.
Download your FREE open source Enterprise Search Engine today!
Our experts will assist you in its installation for $59/mo, no commitment.
Test it for FREE on our Cloud platform anytime!
http://pubads.g.doubleclick.net/gampad/clk?id=145328191&iu=/4140/ostg.clktrk
_______________________________________________
iText-questions mailing list
iText-questions@lists.sourceforge.net
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