Open and save .docx document with React and Node.js

Hi, i have a web application which runs with React on frontend and nodejs on backend. I want to open the docx file on the nodejs server in the react side and restore the same file after editing it. How can I do this? can you share a code sample? how can i convert docx to sfdt with javascript? thank you.

edit: i manage to save file to server (saveAsBlob()) but i need to open file from server. i think i need to conver .docx format to sfdt format. how to conver docx fortmat to sfdt format with nodejs? i need this public static WordDocument Load(Stream stream, FormatType type); function source code for implement to javascript 


7 Replies 1 reply marked as answer

KB Kurthis Banu Abdul Majeeth Syncfusion Team June 2, 2021 10:13 AM UTC

Hi Eren, 

Regarding: React on frontend and nodejs on backend (&) how to conver docx fortmat to sfdt format with nodejs?  

Document Editor doesn’t have support in backend Node.js. We have support on ASP.NET Core, MVC and Java. 

For your reference, kindly refer the below webservice link.  

We will provide the sample based on your requirement frontend React.js and backend ASP.Net Core or MVC. 
  
Please let us know whether this will satisfy your requirement. If yes, we will provide sample based on that.  

Regarding: how can i convert docx to sfdt with javascript 

Using save API or on Ctrl+S action, you can convert the Docx to sfdt. Kindly refer the below documentation link for your requirement. 

Documentation Link: 


Regarding: i need this public static WordDocument Load (Stream stream, FormatType type); function source code for implement to javascript  
 
 
Currently, DocumentEditor does not provide support for Document conversion in client side (javascript). If you maintain the document in Sfdt format in client side, you can import it without server-side dependency.  
DocumentEditor requires server side dependency to convert the document in any supported format (Docx,Docx, rtf) to sfdt.  

On toolbar open function, this API will trigger. Please check below documentation for reference: 


Regards, 
Kurthis Banu A. 



EY Eren Yüksel June 3, 2021 09:22 AM UTC

Hi, thank you for your answer but none of this solutions helped me. I need to convert docx file to sfdt with javascript. Please help me with that. 


SM Suriya Murugan Syncfusion Team June 4, 2021 04:39 AM UTC

Hi Eren, 

Currently, Documenteditor doesn’t have support to parse docx to sfdt in client side. We have already logged the feature request for this. We will include it in any of our upcoming release. You can track the status of feature through below feedback link: 


Please let us know if you have any questions. 

Regards, 
Suriya M. 


Marked as answer

EY Eren Yüksel June 4, 2021 09:11 AM UTC

Hi Suriya, actually i don't want this for React (client). Our backend is all developed using node.js. You expect me to install java or asp .net server just to convert docx to sfdt format. unnecessary workload for a simple function call.


SM Suriya Murugan Syncfusion Team June 7, 2021 04:58 AM UTC

Hi Eren, 

We are sorry to say that as we mentioned earlier, Documenteditor doesn’t have backend support in nodeJS. We don’t have any plan for NodeJS backend. 


Regards, 
Suriya M. 



EY Eren Yüksel June 7, 2021 06:46 AM UTC

Hi Suriya, I'm sorry to hear about that. if you could provide some help i can implement node.js side and share.


SM Suriya Murugan Syncfusion Team June 8, 2021 06:15 AM UTC

Hi Eren, 

Please find the workflow Documenteditor backend: 

Documenteditor depends on DocIO. DocIO depends on compression and office chart. DocIO will process the whole docx document- Extract the Docx file and parse each tag. After that Documenteditor, will parse the DocIO content. 

Currently, we implemented this source code in c#. Process is complex. So,it is not possible to implement this by yourself in nodeJs with required dependency dll. 

Please let us know if you have any questions. 

Regards, 
Suriya M. 


Loader.
Up arrow icon