Hello,
I'm using the PDF library to generate documents. I have a requirement where I have to generate a PDF document listing all of a customer's data in tabular form. That means I need to generate a PDF with a PdfGrid containing up to 20,000,000 rows. Even generating a document with a PdfGrid containing 100,000 rows takes almost 10 minutes.
The PDF library (via PdfDocument) appears to create the entire document in memory, and only then allows saving it to disk when the document is fully created.
Is it possible to use a FileStream as the underlying stream and periodically flush the document to disk while it is being generated? Like, after I add 10,000 rows to the PdfGrid, can I flush the current memory contents to disk?
Are there other ways to reduce the amount of memory used when generating large PDFs?
Thank you,
Jon
Thank you for the response.
I have a reproduction of the issue here:
https://github.com/jonsagara/SyncfusionGenerateLargePdf
Is it possible for you to take a look at it and make recommendations to increase performance?
Great. Thank you.
Hi Gowthamraj,
Thank you for the time and effort you have put into coming up with a solution. Unfortunately, having breaks in the middle of the document where they were merged together doesn't work for us. We need the grid to be contiguous. It's unfortunate because the library works perfectly for all of our other use cases.
Is there a chance that you'll be able to improve the performance of the library to make my original code work?
Thanks,
Jon