We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Question about creating doc files in Aspose.Words

I am creating reports in Aspose.Words, by iterating thru DataTables and then calling builder.Write(String) when its time to right something. I've noticed that i get an exception thrown in C# of 'SystemOutOfMemory', im using c# 2.0. I noticed that this code ran fine and produced a 33Meg file when my i was 200000 but got the error when i increased the i value up to 300000 (intRowNumber).

Aspose.Word.License license = new Aspose.Word.License();

license.SetLicense(Server.MapPath(@"~\bin") + @"\Aspose.Word.lic");

Aspose.Word.DocumentBuilder builder = new Aspose.Word.DocumentBuilder(doc);

GenerateDoc(Convert.ToInt32(strSearchParameter), builder);

protected void GenerateDoc(int intRowNumber, Aspose.Word.DocumentBuilder builder)

{

for (int i = 0; i < intRowNumber; i++)

{

// 71 characters an sit on one line with my margins with default

builder.Writeln("012345678901234567890123456789012345678901234567890123456789012345678901");

}

}

Does Aspose.Words have maybe an upperbound for file sizes? This computer is a 2.66 Hz on XP Pro SP2 with 4 gigs of RAM if that helps.

Here is what I have gathered:

Loop Value | Filesize (MB) | Bytes Per Line

100000 | 16535552 | 165

200000 | 33058816 | 165

250000 | 41320448 | 165

275000 | 45449216 | 165

285000 | 47099904 | 165

295000 | 48754688 | 165

Like i said in my previous post, at 300000 i get a 'SystemOutOfMemory' exception thrown. The text im using is 71 characters on 1 line and at 165 bytes per line, it looks like each character is 2 bytes. This was just an interesting trend leading up to 300000 that i noticed.

Hi<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Thanks for your inquiry. I think that it is not a good idea to use so huge documents. I would like to suggest you to use few small documents instead of one huge document.

On my side I am able to generate the document up to 65Mb (400000 iterations in your loop).

Best regards.