How I can convert sfdt to docx file in server-side

Please help me . 
I want to convert a lot of sfdt data in database to rtf file in server-side
thanks

1 Reply 1 reply marked as answer

KB Kurthis Banu Abdul Majeeth Syncfusion Team June 1, 2021 07:24 AM UTC

Hi Tông, 

Thanking for contacting Syncfusion support.  

Kindly use this below code snippet to achieve your requirement.  

Code snippet: 

//API controller for the conversion. 
[HttpPost] 
public HttpResponseMessage ExportAsRtf() 
    System.Web.HttpPostedFile data = HttpContext.Current.Request.Files[0]; 
    //Opens document stream 
    WordDocument wordDocument = new WordDocument(data.InputStream); 
    MemoryStream stream = new MemoryStream(); 
    //Converts document stream as RTF 
    wordDocument.Save(stream, FormatType.Rtf); 
    wordDocument.Close(); 
    stream.Position = 0; 
    return new HttpResponseMessage() { Content = new StreamContent(stream) }; 
 


Kindly refer the below documentation link also,  

Documentation Link:  




Please let us know If you are facing any issues. 


Regards, 
Kurthis Banu A. 


Marked as answer
Loader.
Up arrow icon