in my document i am creating 3-4 pdfptables. at design time i dont know the size of the tables. i need to place the 2nd table right after the first, but i dont know the position of the first (i cant calculate it because i dont know how big it is). how do i know where to place the second table?
+1
A:
You can figure out the total height of the table dynamically. After you use the WriteSelectedRows()
function, you can call the .TotalHeight()
property to find out how tall your table was (in points). Then figure out with some calculations where it ends and where the next one should begin.
Jason
2009-09-03 18:26:00
thanks very much! please help me with this one http://stackoverflow.com/questions/1375677/itextsharp-pdfptables-are-running-into-each-other
I__
2009-09-03 20:14:11
A:
That's right the table height and width is dynamically calculated, but you don't have to call WriteSelectedRows()
function. You have to set either height or width.
In my case I had to first calculate that if font used can fill the page if not I had to dynamically change the font appropriately. So I find (by mistake) if you set TotalWidth
the TotalHeight
is automatically set/calculated.
Sanjay
Sanjay Zalke
2010-03-04 13:02:04