[ujac-support] [bram@itext.as.avontuur.org: iText - keeping tables on one page + patch]
Brought to you by:
lauerc
|
From: Bram <br...@uj...> - 2005-11-18 12:57:40
|
Hi, please see below ... I've included the patch needed for UJAC to get the keepTogether pdftable property working properly. This patch only works with the version of Itext that is currently in CVS though! Kind regards, Bram ----- Forwarded message from Bram <br...@it...> ----- From: Bram <br...@it...> To: ite...@li... Subject: iText - keeping tables on one page + patch X-Verification-Tag: brama@localhost Hi, I've been trying to generate PDF documents using a combination of iText and UJAC. The documents have multiple tables, always nested inside other containers. I noticed that, even though UJAC has a keepTogether attribute for tables, that tables are still split across two pages even if it would fit on a single page if a new page would have been started first. This only occurs when tables are nested inside other containers (chapters, sections), not when the table is directly added to a page. The keepTogether attribute works by calling PdfDocument's fitsPage method. However, after checking this the table is added to its current container and not committed to the document just yet. This only happens when the entire container embedding multiple tables is added to the document. Therefore, the fitsPage test is useless at this point because the content of the page only changes as the entire container is added. To fix this problem, I decided to move the fitsPage check to iText itself, when a PdfPTable object is actually added to the document directly. I've attached the patch (for the CVS repository) to do this. For it to work correctly, UJac also has to be patched because it has to set the (new) keepTogether attribute for PdfPTable objects. But that's for another mailing list.. I was hoping this could be included if deemed a sensible solution. If there was another solution that I somehow overlooked or if the problem is not clear, then I'd be more than hapy to hear about it. Regards, Bram ----- End forwarded message ----- -- Despite the cost of living, have you noticed how it remains so popular? |