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

Free Support Forum - aspose.com

Presentation out of memory exception

Hi

We are generating presentations of a large size and repeatedly get the following:

System.OutOfMemoryException: Exception of type 'System.OutOfMemoryException' was thrown.

at System.IO.MemoryStream.set_Capacity(Int32 value)

at System.IO.MemoryStream.EnsureCapacity(Int32 value)

at System.IO.MemoryStream.Write(Byte[] buffer, Int32 offset, Int32 count)

at t.a(Stream A_0)

at Aspose.Slides.Presentation.Write(Stream stream)

The code is as follows

public byte[] Export()

{

MemoryStream pptStream = new MemoryStream();

downloadPresentation.Write(pptStream);

pptStream.Flush();

pptStream.Position = 0;

byte[] bFile = new byte[pptStream.Length];

pptStream.Read(bFile, 0, bFile.Length);

pptStream.Flush();

pptStream.Close();

pptStream.Dispose();

return bFile;

}

The presentation is initialized as follows

downloadPresentation = new Presentation(GetTemplateStream(this.iTemplateId));

where GetTemplateStream(this.iTemplateId) returns a file from stream.

Is this a known issue, if not is there a resolution to this?

Tayo

Hi,

There is no other limitation except that the application should work in a standard environment with full trust mode. For more information, study this thread.