I have to generate large PDF files , which has table with 30000 rows. I have to generate around 40 files which is taking 19 hours. Could any body suggest optimized way for the same. Most of the time taken by document.add(table) method.
I am using ITEXT 5.4
I used features of larElement interface , in my table I have 40 to 96 columns.
I can post the code later. below is pseudo code.
public void createTable(rs,document){
PdfpTable table = new PdfPTable(96)
table.setComplete(false);
int K=1;
while(rs.next) {
for(int i=1,i <=columnCount;i++) {
PdfPCell cell = new PdfPCell();
Chunk chunk = new Chunk(rs.getString(i))
cell.addElement(chunk);
table.addCell(cell)
}
k++;
}
if(k%==10000) {
document.add(table);
}
table.setComplete(true);
document.add(table);
}