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. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to export the contents of documenteditor to json?

Thread ID:

Created:

Updated:

Platform:

Replies:

142037 Jan 16,2019 07:40 AM UTC Jan 16,2019 12:12 PM UTC JavaScript - EJ 2 1
loading
Tags: DocumentEditor
john rod
Asked On January 16, 2019 07:40 AM UTC


Hello.

I want to export the contents of documenteditor to json and store it in my database.

There was no way to export the manual for documenteditor export to json.

Please let me know if there is a way to do documenteditor.toJson (), as opposed to documenteditor.open ().

Mugunthan Anbalagan [Syncfusion]
Replied On January 16, 2019 12:12 PM UTC

Hi John, 

Thank you for contacting Syncfusion support. 

In our DocumentEditor control, we can obtain the content in the form of Json by using `saveAsBlob` method. 
  
Sample Code 
documenteditor.saveAsBlob('Sfdt').then(function (sfdtBlob) { 
    var fileReader = new FileReader(); 
    fileReader.onload = function (e) { 
        // Get Json string here 
        var sfdtText = fileReader.result; 
       // This string can send to server for saving it in database 
        alert(sfdtText); 
    } 
    fileReader.readAsText(sfdtBlob); 
  }); 
 
We have prepared a sample to demonstrate this. Please do find the sample from below link.  
  
  
Kindly try this solution and let us know if this helps you. 

Regards, 
Mugunthan A 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon