Mark Hall <mhall <at> edu.uni-klu.ac.at> writes: > > On Friday 19 August 2005 16:09, Valentin Baudot wrote: > > What is it supposed to do? The document object is still big in memory... > > Perhaps I don't correctly use it. > > Moreover, I have a very big chapter (several hundred pages) and when I add > > it to the document by using the add method, it takes more than 1200MB in > > memory (I got an "out of memory" at this moment), why it so big? Is there a > > way to avoid that? > > > > The best for me would be to write the document content each time I use the > > add method on the document object or even on the chapter or section > > objects. is it possible? > If you set the rtfWriter2.setDataCacheStyle(RtfCache.CACHE_DISK) then the > elements are written as soon as possible. Due to differences in the way parts > of the iText objects are structured and how the rtf format works the objects > are transformed into rtf specific objects for processing. For nested > structures like Chapters that contain other Chapters or Paragraphs this is of > course problematic. > > I would recommend that instead of creating one big Chapter you add the Chapter > with the title and then add each Paragraph directly to the Document. You will > have to correct the indentation, but otherwise it makes no difference in the > final rtf document. Thanks a lot, I used the setDataCacheStyle() method and add every object to the document object instead of the chapter one.
The only remained problem is that when I add a chapter object to the document, a new page is generated after the chapter, so I have a new page between the chapter title and the first section... Any idea how I can get ride of that new page ? Thanks. Valentin. ------------------------------------------------------- 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 [email protected] https://lists.sourceforge.net/lists/listinfo/itext-questions
