[EMAIL PROTECTED] wrote: > > Ok, I have done some further testing and have found the following > possible bug...
It's NOT a bug; it's wrong use of iText. You didn't understand Paulo's advice: "PdfPTable.getRowHeight(). You must set the total width first." I don't know if you already have the book, but the combination of these two lines doesn't make sense: doutTable.setWidthPercentage(100); doutTable.setTotalWidth(24.0f); Either you want to set the width as a percentage (100%) or you want to set the width absolutely, but in your case the second line is ignored, because you didn't do: doutTable.setLockedWidth(true); And even if you add that line, it would lead to a very ugly result because 24pt is very small for a table. What you need is: doutTable.setTotalWidth(document.right() - document.left()); doutTable.setLockedWidth(true); If the "width" is "locked", iText knows it should use that value AND it will ignore the width percentage (so you might as well drop that line). So far for the solution to your problem. Now for your allegation that this is a bug in iText. It would go against any logic if iText was able to get the height of the first row right in your example. That would be simply impossible! (And "in this house we obey the rules of thermodynamics!") Why impossible? Well, you create a table object with a width of 100%. Then you add enough cells to fit one row and you ask the height of that row. But you didn't add the table to the document yet! There is no way for the table to know the available width. It's 100% of what? Of 24pt? By the way, where did you get that value? It looks like you chose a number arbitrarily. The table object can't know this until you add the table to the document. At that moment, you commit that table to a specific document, with a specific width (document.right() - document.left()) and because of that, the height of the rows following that first row can be calculated correctly. best regards, Bruno ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ _______________________________________________ iText-questions mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/itext-questions Do you like iText? Buy the iText book: http://www.1t3xt.com/docs/book.php Or leave a tip: https://tipit.to/itexttipjar
