I have a problem with doc.LoadFromFile() method
I tried to load file in different ways, but I got the same result
- Code: Select all
Spire.Doc.Document doc = new Spire.Doc.Document(f.FullName, Spire.Doc.FileFormat.Auto);
//Spire.Doc.Document doc = new Spire.Doc.Document();
//byte[] fileBytes = File.ReadAllBytes(f.FullName);
//using (MemoryStream ms = new MemoryStream(fileBytes))
//{
// doc.LoadFromStream(ms, Spire.Doc.FileFormat.Auto);
//}
foreach (Spire.Doc.Section seс in doc.Sections)
if (seс.Tables.Count > 0)
GetTablesRecursiv(seс.Tables, NtfNr, f.Name, collection);
doc.Close();
here the details of exception
HResult=-2146233080
Message=Индекс находился вне границ массива.
Source=Spire.Doc
StackTrace:
в spr☵.ᜀ(Byte[] A_0, Int32 A_1, Int32& A_2)
в sprᤗ.ᜁ(Byte[] A_0, Int32 A_1)
в sprᤗ..ctor(spr♇ A_0)
в sprậ.ᜂ(spr☖ A_0)
в sprậ..ctor(Byte[] A_0, String A_1)
в Spire.Doc.Fields.DocOleObject.ᜀ(Stream A_0)
в sprᨕ.ᜀ(spr‒ A_0, FieldType A_1)
в sprᨕ.ᜀ(spr‒ A_0, sprℹ A_1, String A_2)
в sprᨕ.ᜀ(spr‒ A_0, sprℹ A_1)
в sprᨕ.ᜉ(spr‒ A_0)
в sprᨕ.(spr‒ A_0)
в sprᨕ.ᜀ(spr‒ A_0, Body A_1)
в sprὅ.ᜀ(spr᭯ A_0, Document A_1)
в Spire.Doc.Document.ᜈ(String A_0)
в Spire.Doc.Document.LoadFromFile(String fileName, FileFormat fileFormat, String password)
в Spire.Doc.Document..ctor(String fileName, FileFormat type)
Where can I send a file for testing?
Thank U!