Memory Probleme

Hi

we are using the aspose.word to create the documents, and we met a problem of memory :
we have a template file, and with this file ,our clients may want to create the document with thousands of pages like it, that takes a really long time. To avoid the problem of "too many styles ", we tried to creat the document every 300 pages, and at the end, merge the files …
we used

Document.AppendDocument(tempDoc, ImportFormatMode.UseDestinationStyles)

for example, with twos documents(20~30 M), the memory of the application will go to 250 M…

Is there a solution for this problem…?
and if we saved the document in the hard disk, is there a way to append the content of another document like the File.AppendText() , just write the content at the end of the files, and maybe not to read all the content into the memory by Document= new Document(…) ?

Thank you

Hi

Thanks for your request. Memory usage depends on document size, format and document’s content. Usually Aspose.Words needs few times more memory than document size to build model of the document in memory.
Also, I would like to say that producing huge MS Word documents is not very good practice. MS Word does not like huge documents. Usually it takes a lot of time to open such documents in MS Word and sometimes MS Word just hangs. Normal size of MS Word documents is 100 – 200 pages. So I suggest you just generate few small documents instead of one huge document.
Regarding AppendText, this is impossible. MS Word documents are not just TXT files they have complex structure and it is impossible just to write to the end of the file.
Best regards.