Hi. I was using version 19.3.0.45 of Syncfusion.EJ2.WordEditor.AspNet.Core and my code worked as I expected but when upgrading the package to anything higher I get a null reference exception.
"something" is a sftd string.
Thank you.
Hi Kurthis
Thank you for responding. I've attached my sftd file zipped.
Kind regards,
Prashan
|
[AcceptVerbs("Post")]
[HttpPost]
[EnableCors("AllowAllOrigins")]
[Route("SaveDocument")]
public string SaveDocument([FromBody] SaveParameter data)
{
try
{
Stream document = WordDocument.Save(data.content, FormatType.Docx);
FileStream file = new FileStream("sample.docx", FileMode.OpenOrCreate, FileAccess.ReadWrite);
document.CopyTo(file);
file.Close();
document.Close();
return "Sucess";
}
catch(Exception e)
{
return (e.Message);
}
} |
Thank you for your response. I think you were right to suspect the sftd file. I investigated further and noticed that a package Syncfusion.EJ2.JavaScript was way out of date. Comparing what I had with the most recent, the sftd was alot different with the newer sftd working correctly with WordDocument.Save(). I think we could mark this as resolved. Thanks again.