Saving of a Document created in Syncfusion Document editor

Hi Everyone, 

I am in the process of developing a document editor application using Sync fusion document editor. When it comes to saving, we can save it in various formats live docx, pdf, sfdt etc. I would want to know how to save the data into a database table and retrieve the same with styles to display it in Document editor.

 


8 Replies

BS Balamurugan Shanmugam Syncfusion Team June 27, 2023 02:46 PM UTC

Hi Chandrashekar,


# How to save in DB

We have provided the saveAsBlob API to get the document as a blob; further, you can proceed to save and retrieve data into the database using that blob; or we have provided the serialize API to get the document as a sfdt; further, you can proceed to save and retrieve data into the database using that sfdt; and again, you can load the document using the retrieved sfdt using the open API. And you can also use the above APIs to meet your requirements.

https://ej2.syncfusion.com/angular/documentation/document-editor/export#export-as-blob

https://ej2.syncfusion.com/angular/documentation/api/document-editor/#serialize

https://ej2.syncfusion.com/angular/documentation/api/document-editor/#open

KB Link: https://support.syncfusion.com/kb/article/11599/how-to-load-save-file-in-web-server-for-asp-net-core


Regards,

Balamurugan S



CH Chandrashekar June 27, 2023 10:56 PM UTC

Hi Balamurugan,


Thank you for the update truest appreciate the same.


Alternatively my requirement is to save each paragraph in the document to sql database along with their properties likes all the styles etc and retrieve the same and display the same back in the syncfusion document editor

The plan of saving individual items is to reuse the data across multiple documents


Thanks & Regards,

Shekar



KM Kavitha Muralitharan Syncfusion Team June 28, 2023 03:05 PM UTC

Hi Chandrashekar,



Currently we are checking the scenario and will update the details on June 30, 2023.


Regards,

Kavitha M



CH Chandrashekar June 29, 2023 04:46 AM UTC

Thank you Kavitha, Appreciate the same.

Looking forward to it.



KM Kavitha Muralitharan Syncfusion Team June 30, 2023 01:13 PM UTC

Hi Charandrasekar,

We have prepared a sample to save the current loaded document as split's section wise in the server-side on clicking "Save to server" and when clicked "Open from server". Internally we have used the SFDT format and processed the section splitting and merging on opening.


Client-side sample: https://stackblitz.com/edit/angular-33nlbr-ufqcfk?file=src%2Fapp.component.ts,src%2Fapp.component.html

Server-side sample can be found in the attachment. 


Regards,

Kavitha M



Attachment: ASP.NET_Core_d9681b32.zip


CH Chandrashekar July 3, 2023 04:54 AM UTC

Hi Kavitha


Is it possible to share a copy of the Database that was used with the structure, so that i would be able to an end to end testing of our requirements. 


Regards

Shekar



KM Kavitha Muralitharan Syncfusion Team July 7, 2023 04:34 AM UTC

Hi Chandrashekar,


Currently, we are checking and will get back to you by July 11, 2023.


Regards,

Kavitha M




KM Kavitha Muralitharan Syncfusion Team July 13, 2023 12:17 PM UTC

Chandrasekar, we have prepared the sample for the following cases, so please refer to the below-attached sample.

  • Save the docx-format (as a byte) document in the database.
  • Convert the SFDT to HTML in the backend and save that HTML to the database.
  • Open the saved HTML in the document editor.
  • Open the saved docx document in the document editor. 

Client-side sample: Nyyyqs (forked) - StackBlitz 



Attachment: EJ2APIServices_7c3661fe.zip

Loader.
Up arrow icon