Hi,
I evaluate aspose products and try to export html file to a various formats. I have generated big html file (similar to attached one) which has size ~100MB. It was successfully converted to excel but failed to convert one to pdf. OutOfMemory exception occured in document constructor.
Code I used:
var document = new Document(htmlStream, new HtmlLoadOptions());
document.Save(outputStream, SaveFormat.Pdf);
System.OutOfMemoryException was unhandled
HResult=-2147024882
Message=Exception of type ‘System.OutOfMemoryException’ was thrown.
Source=mscorlib
StackTrace:
at System.Collections.Generic.List
1.set_Capacity(Int32 value)</div><div> at System.Collections.Generic.List
1.EnsureCapacity(Int32 min) at System.Collections.Generic.List
1.Add(T item)</div><div> at System.Collections.Generic.List
1…ctor(IEnumerable`1 collection) at . …ctor( )
at . . ( )
at . . (Stream )
at . . (Stream , . )
at . .Convert(Stream , )
at . .Convert(Stream , Document , , HtmlLoadOptions )
at Aspose.Pdf.Document. (Stream , LoadOptions )
at Aspose.Pdf.Document…ctor(Stream input, LoadOptions options)
at Aspose.Exporters.AsposeHtml2PdfExporter.Export(Stream output, ReportDataSource source, IHtmlReportEngine html) in D:\poc\aspose\Aspose\Aspose\Exporters\AsposeHtml2PdfExporter.cs:line 24
at Aspose.Program.ProcessExportT in D:\poc\aspose\Aspose\Aspose\Program.cs:line 30
at Aspose.Program.Main(String[] args) in D:\poc\aspose\Aspose\Aspose\Program.cs:line 17
at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
InnerException:
Any ideas how to avoid this?
Thanks in advance!