I'm trying to generate a Word document using Spire.Doc and download it. I can download the document, but it is empty. Does anyone have any idea why that is and can help me? This is my code:
Document doc = new Document();
Paragraph paragraph = doc.AddSection().AddParagraph();
paragraph.AppendText("Hello World!");
doc.SaveToFile("Example.doc", FileFormat.Doc);
//Saves the Word document to MemoryStream
MemoryStream stream = new MemoryStream();
stream.Position = 0;
//Download Word document in the browser
return File(stream, "application/msword", "Example.doc");