1

We are using iTextSharp to generate some PDF files presenting big table with a large number of rows (more than 100,000).

It takes quite a long time (more than 25secondes on my Intel i7 2600k). After adding some timers, I realized that most of the time (17seconds) is spend when the PDFPTable is added to the PDFDocument.

I've search a lot about possible optimization (you know, like when on a listview, you call SuspendLayout(), add your rows, then ResumeLayout()) but found nothing. On the iText in Action book, they're only talking about fragmenting table for better memory management. I've tried it but it result in the same time for generation.

Is there something I can do ? 25 secondes is quite a long time.

Regards,

  • 3
    Without actually answering your question...First thing I'd say would be why would you generate a PDF file with 100,000 rows. I'm sure that much data is not for display or printing purposes - I'm guessing for archival data, and PDF doesn't make sense for that. Raw data (a database, delimited or fixed-width text file, or structured text like XML or JSON) would make more sense to me, and you can query as needed to retrieve whatever useful data you need to. – Joe Enos Apr 09 '13 at 15:06
  • 1
    25 seconds actually sounds quite fast to me, considering the 100.000 rows – Alex Apr 09 '13 at 15:11
  • I don't know if this helps but try this http://stackoverflow.com/a/15483598/231316 – Chris Haas Apr 09 '13 at 19:57

0 Answers0