Java Mailing List Archive

http://www.junlu.com/

Home » Home (12/2007) » iText »

Re: [iText-questions] Performance Tips: Creating PDF For Large
Table  --plz help--

Vinod Lamba

2007-08-03

Replies:

Guys,

Please help!
                           
Thanks!                      
                           
Vinod     Google |            
Lamba         IBM 810.835.2046    
                           





|------------>
| From:    |
|------------>
>--------------------------------------------------------------------------------------------------------------------------------------------------|
|Vinod Lamba/India/IBM@(protected)                                                                               |
>--------------------------------------------------------------------------------------------------------------------------------------------------|
|------------>
| To:     |
|------------>
>--------------------------------------------------------------------------------------------------------------------------------------------------|
|itext-questions@(protected)                                                                         |
>--------------------------------------------------------------------------------------------------------------------------------------------------|
|------------>
| Date:    |
|------------>
>--------------------------------------------------------------------------------------------------------------------------------------------------|
|08/02/2007 04:36 AM                                                                                     |
>--------------------------------------------------------------------------------------------------------------------------------------------------|
|------------>
| Subject:  |
|------------>
>--------------------------------------------------------------------------------------------------------------------------------------------------|
|[iText-questions] Performance Tips: Creating PDF For Large Table --plz help--                                             |
>--------------------------------------------------------------------------------------------------------------------------------------------------|





Hi,

Can you please point me some document/link or some tips/tricks for creating
a pdf w/ very large tables ?

Our requirement is to create a pdf w/ this data from oracle tables (upto
15000 rows) in less than 2-3 seconds excluding the time taken in database
related operations.

Here is my code snippet:

Document document = new Document(PageSize.LETTER.rotate(), 10, 10, 20, 20);
PdfWriter writer = PdfWriter.getInstance(document, new
BufferedOutputStream(new FileOutputStream(pdfFileName)));
writer.setViewerPreferences(PdfWriter.PageLayoutSinglePage |
PdfWriter.FitWindow);
writer.setFullCompression();
document.open();

PdfPTable table = new PdfPTable(10);

ResultSet resultSet = stmt.executeQuery(query);
while (resultSet.next()) {
   table.addCell(resultSet.getString(x));
}

document.add(table);
document.close();

It taking more than 12-15 secs to create a pdf for 13000 rows with 10
columns in a table.

Thanks!
-Vinod


-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
iText-questions mailing list
iText-questions@(protected)
https://lists.sourceforge.net/lists/listinfo/itext-questions
Buy the iText book: http://itext.ugent.be/itext-in-action/



-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
iText-questions mailing list
iText-questions@(protected)
https://lists.sourceforge.net/lists/listinfo/itext-questions
Buy the iText book: http://itext.ugent.be/itext-in-action/
©2008 junlu.com - Jax Systems, LLC, U.S.A.