iText has a flaw here in that the content is written to the disk but the xref and page tree is kept in memory. It's not easy to cache this to disk as it's a TreeMap that must be updated. Maybe some day.
----- Original Message ----- From: "bruno" <[EMAIL PROTECTED]> To: "yuanjk" <[EMAIL PROTECTED]> Cc: <itext-questions@lists.sourceforge.net> Sent: Thursday, August 11, 2005 6:51 AM Subject: Re: [iText-questions] Why out of memory > yuanjk wrote: > > >I am so confused . > > > > > I haven't really tested your code, but I think I never saw a > document.newPage(). > So you've got me confused too. You say you want to generate a page with > 1000+ pages, but to test this, you are generating only 1 page with an > enormous amount of data on it. > > >Is iText cache whole document in memory? > > > > > No, everytime a newPage is triggered the contents of the page are flushed. > This is done automatically if you work with document.add(), NOT it you > are adding content to PdfContentByte directly. > > >Can I use tempory file in iText to generate large pdf file with thousand > >pages? > > > > > If you would try making a large pdf with 1000+ pages, you would see > there is really no need to do this. > You could adapt your own code by adding a document.newPage() in your loop. > br, > Bruno > > > ------------------------------------------------------- > SF.Net email is Sponsored by the Better Software Conference & EXPO > September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices > Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA > Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf > _______________________________________________ > iText-questions mailing list > iText-questions@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/itext-questions ------------------------------------------------------- SF.Net email is Sponsored by the Better Software Conference & EXPO September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf _______________________________________________ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions