- Home
- Forum
- ASP.NET Core - EJ 2
- DocumentEditor from json string and converting document to HTML format
DocumentEditor from json string and converting document to HTML format
I have other requirements. Can you help me out on this or any other alternative is appreciated,
1) Requirement: Sending document content in the email body without changing the styles and document content.
Can we convert Document to pure HTML. So, that I can use this HTMLto send in Email body with the same format.
2) Can we load the document from json string. That was created from the following code
WordDocument document = WordDocument.Load(processTuple.Item1, GetFormatType(processTuple.Item2.ToLower()));
string json = Newtonsoft.Json.JsonConvert.SerializeObject(document);
I will be saving the above json in database. In a new request, after fetching the data from database in server side, I will modifying some styles and content and convert back to HTML format.
SIGN IN To post a reply.
1 Reply
SM
Suriya Murugan
Syncfusion Team
September 12, 2019 10:56 AM UTC
Hi Naren,
Thank you for contacting the Syncfusion support.
|
Can we convert Document to pure HTML. So, that I can use this HTMLto send in Email body with the same format.
|
Yes, you can convert the document to pure HTML using Syncfusion DocIO library. Then pass the converted html to email body.
Client side in below sample code check exportAsHtml method:
Server side sample code:
For your convenienet we have prepared sample, kindly check it in below link:
Please let me know if you have any concerns.
| |
|
Can we load the document from json string. |
In backend, it is not possible to convert the json string to document.
In client side, using saveAsBlob you can convert the save the document as Docx option and get is as a blob stream and then pass that stream to server. Then proceed further for your requirement.
Open the sfdt in DocumentEditor using open method and then save it using saveAsBlob method.
Sample link:
|
Please let me know if you have any concerns.
Regards,
Suriya M.
SIGN IN To post a reply.
- 1 Reply
- 2 Participants
-
NA Naren
- Sep 12, 2019 07:41 AM UTC
- Sep 12, 2019 10:56 AM UTC