Anji, You can save the document as DOCX by passing SFDT to the server.
We have changed the path to be similar to the LoadDocument API. Now you can load the template document from the server using the LoadDocument API and save it to the same location. We have prepared a video for your reference.
Please modify the code in the save API as shown below.
Code snippet:
[AcceptVerbs("Post")]
[HttpPost]
[EnableCors("AllowAllOrigins")]
[Route("Save")]
public void Save([FromBody] SaveParameter data)
{
string savePath = Path.Combine(path, data.FileName);
string format = RetrieveFileType(name);
WDocument document = WordDocument.Save(data.Content);
FileStream fileStream = new FileStream(savePath, FileMode.OpenOrCreate, FileAccess.ReadWrite);
document.Save(fileStream, GetWFormatType(format));
document.Close();
fileStream.Close();
}
public class SaveParameter
{
public string Content { get; set; }
public string FileName { get; set; }
}
|
Please let us know if you are still facing the issue
Attachment:
media1_78525956.zip