Hi Paulo,

your new version is really great in functionality and provides cool
features!

Unfortunately it looks like the performance in PdfPTable processing has
gone down a bit. I've attached a test program which generates lots of
tables. This program executes more than 3 times faster with the official
iText version (1.02b) than with your newest version from itextpdf.sf.net
;-(

Best regards,
Christian

package ujac.test.itext;

import java.io.FileOutputStream;

import com.lowagie.text.Document;

import com.lowagie.text.PageSize;
import com.lowagie.text.Phrase;

import com.lowagie.text.pdf.PdfPCell;
import com.lowagie.text.pdf.PdfPTable;
import com.lowagie.text.pdf.PdfWriter;

public class TablePerformanceTest {
  
  public static void main(String[] args) {
    
    try {
      long startTime = System.currentTimeMillis();
      FileOutputStream os = new FileOutputStream("test.pdf");
      Document document = new Document(PageSize.A4, 25, 25, 25, 25);
      PdfWriter documentWriter = PdfWriter.getInstance(document, os);
      
      document.open();

      int numTables = 200;
      int numCells = 100;
      
      for (int i = 0; i < numTables; i++) {
        PdfPTable table = new PdfPTable(4);
        for (int j = 0; j < numCells; j++) {
          PdfPCell cell = new PdfPCell(new Phrase("Test"));
          table.addCell(cell);
          cell = new PdfPCell(new Phrase("Zwo"));
          table.addCell(cell);
          cell = new PdfPCell(new Phrase("Drei"));
          table.addCell(cell);
          cell = new PdfPCell(new Phrase("View"));
          table.addCell(cell);
        }
        document.add(table);
      }

      document.close();
      documentWriter.close();
      long endTime = System.currentTimeMillis();
      System.out.println("Took " + (endTime - startTime) + " to print " + numTables + " tables with " + numCells + " cells.");
      
    } catch (Exception ex) {
      ex.printStackTrace();
    }
  }
  
}

Reply via email to