- Code: Select all
[NullReferenceException: Object reference not set to an instance of an object.]
spr᳝.ᜀ(ListLevel A_0, String A_1) +221
spr᳝.ᜁ(XmlReader A_0, ListLevel A_1) +1665
spr᳝.ᜀ(XmlReader A_0, ListStyle A_1) +345
spr᳝.ᜒ(XmlReader A_0) +238
spr᳝.᜕(XmlReader A_0) +541
spr᳝.ᜁ(sprᢇ A_0) +542
spr᳝.ᜁ(Document A_0) +74
spr᳝.ᜁ(Stream A_0, Document A_1) +157
Spire.Doc.Document.ᜍ(Stream A_0) +69
Spire.Doc.Document.LoadFromStream(Stream stream, FileFormat fileFormat, String password) +499
Spire.Doc.Document.LoadFromStream(Stream stream, FileFormat fileFormat) +11
And this is a snippet from my code:
- Code: Select all
using (var stream = new MemoryStream(myDoc.GetBytes())) // Another component will replace tags inside the doc..
{
Document documentPdf = new Document();
documentPdf.LoadFromStream(stream,FileFormat.Auto); //Throw exception.
documentPdf.SaveToFile(filePath, FileFormat.PDF);
}
What I'm doing wrong? If I load from file it's work 100%.