Use a PdfPTable, the height is calculated only once per row.

Best Regards,
Paulo Soares

> -----Original Message-----
> From: Carmona Perez, David [SMTP:[EMAIL PROTECTED]
> Sent: Tuesday, September 23, 2003 12:00
> To:   Itext-Questions (E-mail)
> Subject:      [iText-questions] Efficiency of writer.fitsPage(table)
> 
> Hi,
>  
> In the iText tutorial (
> <http://www.lowagie.com/iText/tutorial/ch05.html#memory>), a memory saving
> technique is described for large tables.
> The code is something similar to this:
>  
>             Table datatable = getTable();
>             
>             for (int i = 1; i < 30; i++) {
>  
> datatable.setDefaultHorizontalAlignment(Element.ALIGN_LEFT);
>                 datatable.addCell("myUserId");
>                ....                
>                 if (!writer.fitsPage(datatable)) {
>                     datatable.deleteLastRow();
>                     i--;
>                     document.add(datatable);
>                     document.newPage();
>                     datatable = getTable();
>                 }
>             }
>  
> Although this solution works ok, is not very efficient, for each row that
> is added to the table, a full PdfTable is created and its height computed.
> If in a page fits 70 rows, the height of row 1 will be computed 70 times.
>  
> Is there any alternative?
>  
> I propose some method of finding the height of a row.
> --------
> David
>  


-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
iText-questions mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/itext-questions

Reply via email to