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

Free Support Forum - aspose.com

Support for huge documents

Hello,

The latest release notes for Aspose.PDF for .NET (21.7) refers to “PDFNET-49595 Advanced streams support to handle huge documents”. Is there some documentation or explanation of this feature?

Thank you

@ast3

This ticket was logged in order to provide support for OptimizedMemoryStream as simple MemoryStream fails to handle large size of the documents. The below code snippet is a representation of this enhancement.

string outFile = @"c:\49840.pdf";
OptimizedMemoryStream ms = new OptimizedMemoryStream();

using (FileStream file = new FileStream(@"c:\4pages.pdf", FileMode.Open, FileAccess.Read))
{
    byte[] bytes = new byte[file.Length];
    file.Read(bytes, 0, (int)file.Length);
    ms.Write(bytes, 0, (int)file.Length);
}
Document doc = new Document(ms);
doc.Save(outFile);