I get an exception when trying to load a file from stream. This is the code that I use to load the presentation:
- Code: Select all
using (FileStream fs = File.Open(fileName, FileMode.Open))
{
presentationFromDisk.LoadFromStream(fs, FileFormat.Auto);
}
The exception with the stack trace is the following:
System.NullReferenceException Object reference not set to an instance of an object.
at spr6698.3()
at Spire.Presentation.ActiveSlide.0(SchemeColor A_0)
at Spire.Presentation.Drawing.ColorFormat.7()
at Spire.Presentation.Drawing.ColorFormat.get_Color()
at spr9888.0(spr6897 A_0, spr5443 A_1, spr7703 A_2, Int32 A_3, Int32 A_4)
at spr9888..ctor(spr646 A_0, spr9305 A_1, spr10471 A_2)
at spr646.4()
at spr646.0(IDictionary A_0)
at Spire.Presentation.GroupShape.PresentationLoaded(IDictionary shapeIdToShape)
at Spire.Presentation.ActiveSlide.PptxAfterLoad(spr7028 loadContext)
at spr6698.0(spr7028 A_0)
at spr10316.2(spr1950 A_0)
at spr10316.0(Stream A_0)
at spr10316.2(Stream A_0)
at spr10316..ctor(Stream A_0, spr2018 A_1)
at Spire.Presentation.Presentation.LoadFromStream(Stream stream, FileFormat fileFormat)
at SpirePresentationTest.Program.Main(String[] args) in c:\Users\user\Documents\Visual Studio 2013\Projects\SpirePresentationTest\SpirePresentationTest\Program.cs:line 31
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()
This happens with just one presentation. It is larger than the maximum allowed attachment size, so if you need the file, I can send it via e-mail.
If you could help make sense of the stack trace or solving the issue it would be very appreciated.
All the best,
Dusan.