I've done some searching through this mailing list so I think I know the answer to this question, but I'd like to verify it because it's not totally clear to me and it will make a big difference as to whether I think I can use iText or not.
Suppose I am generating a large report (e.g. 3000 pages). I want to minimize my use of server memory (RAM). The report is composed of many independent pieces, each of which will usually be pretty small. I can easily see how I can create a bunch of small PDF files, one for each piece of the report, and this will not use much memory at all because I'm always dealing with one small document at a time. However, at the end I need to concatenate these small documents together into one big document (presumably using PdfCopy). My reading of the various postings is that this will be a memory-intensive process, no matter what I try to do. The reason is that you cannot just "append" to a PDF that exists on disk; instead, you have to read in both PDFs to memory and then concatenate them. So if I'm looping through all the little files and adding them to the big document that I'm trying to create, by the time I get to the last little PDF, I now have my full report in memory all at once. In which case it might be better to skip the part about creating all the little separate documents, because you have to be able to hold the big document in memory anyway by the time you've appended all the little ones to create it. On a related topic, I've done some tests in creating a big document and trying to periodically use pdfWriter.flush() to get it to write out a partial file and thus free up some memory, but this doesn't seem to actually do anything (the file on disk does not change size, nor does my memory usage go down). Can someone please verify that I'm understanding this correctly, or show me a way to do what I want to do without having the big document in memory? I have seen some statements that it is only the "xrefs" that need to be in memory for the big document, but I did not know what this meant. Thanks ------------------------------------------------------- This SF.Net email is sponsored by: Power Architecture Resource Center: Free content, downloads, discussions, and more. http://solutions.newsforge.com/ibmarch.tmpl _______________________________________________ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions