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.
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
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
Hi Chandrashekar,
Currently we are checking the scenario and will update the details on June 30, 2023.
Regards,
Kavitha M
Thank you Kavitha, Appreciate the same.
Looking forward to it.
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
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
Hi Chandrashekar,
Currently, we are checking and will get back to you by July 11, 2023.
Regards,
Kavitha M
Chandrasekar, we have prepared the sample for the following cases, so please refer to the below-attached sample.
Client-side sample: Nyyyqs (forked) - StackBlitz