We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

DocumentEditor not able to fully display word file.

I attached my code, video, and the .docx file. Please tell me what part I am missing


Attachment: Example_9b912dea.zip

1 Reply

SM Suriya Murugan Syncfusion Team December 28, 2022 04:02 AM UTC

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);
        // Saves the document to server machine file system, you can customize here to save into databases or file servers based on requirement.
        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

Loader.
Live Chat Icon For mobile
Up arrow icon