hi. some error happened when I new a Presentation object.
using Aspose.Slides;
string path= Path.GetFullPath("../../../data/");
Presentation presentation = new Presentation(path + "pure.ppt");
presentation.Save(path + "pure.pdf",Aspose.Slides.Export.SaveFormat.Pdf);
The Error Info:
Aspose.Slides.PptReadException
HResult=-2146233088
Message=Couldn't read "PowerPoint Document" record.
Source=Aspose.Slides
StackTrace:
at ns53.Class2363.method_9(Class1102 fs)
at ns53.Class2363..ctor(Class1102 fs, ILoadOptions loadOptions)
at ns13.Class831.method_0(Stream stream, ILoadOptions loadOptions)
at Aspose.Slides.Presentation.method_5(Stream stream)
at Aspose.Slides.Presentation.method_4(Stream stream)
at Aspose.Slides.Presentation..ctor(String file, LoadOptions loadOptions)
at Aspose.Slides.Presentation..ctor(String file)
at PdfUtils.Program.Main(String[] args) at F:\res\officeToPdfByAspose\OfficeToPdf\PdfUtils\Program.cs:line num 35
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:
HResult=-2146233088
Message=Couldn't read [Class2080 Start
Self: Class2080, Header:RecordHeader, Type:0x3E8, Version:15, Instance:0, Length:0x0
Class2080 End
]
Source=Aspose.Slides
StackTrace:
at ns55.Class2328.smethod_2(BinaryReader reader, Class2329 stf, Class2039 parentRecord)
at ns55.Class2328.smethod_1(BinaryReader reader, Class2039 parentRecord)
at ns53.Class2363.method_7(MemoryStream stream, Int64 position, Class2039 parentRecord)
at ns53.Class2363.method_9(Class1102 fs)
InnerException:
HResult=-2146233088
Message=Couldn't read [NotDefined]
Source=Aspose.Slides
StackTrace:
at ns55.Class2328.smethod_2(BinaryReader reader, Class2329 stf, Class2039 parentRecord)
at ns55.Class2328.smethod_1(BinaryReader reader, Class2039 parentRecord)
at ns55.Class2055.vmethod_0(BinaryReader reader)
at ns53.Class2039.Read(BinaryReader reader, Class2321 hdr)
at ns55.Class2328.smethod_2(BinaryReader reader, Class2329 stf, Class2039 parentRecord)
InnerException:
HResult=-2146233088
Message= “System.Exception”。
Source=Aspose.Slides
StackTrace:
at ns55.Class2328.smethod_9(Class2321 header, Class2329 stf, Class2039 parentRecord)
at ns55.Class2328.smethod_2(BinaryReader reader, Class2329 stf, Class2039 parentRecord)
InnerException:
The xls file I try to open:
pure.xls at attachment files.
Environment:
.net 4.0
windows 10
Regards.