Hi @mazhar shaikh ,
From your description, I think you should want to render your word document as html in your browser.
No browser currently has the code needed to render a Word document, depending on your code you need to use the js plugin: docx-preview.js
To implement docx-preview.js, you need a JavaScript file that extends the docx-preview.js JavaScript plugin.
In the Success event handler of the jQuery AJAX function, convert the binary data obtained from the Word file (that is, the BLOB object) into an HTML5 File object.
Finally, initialize the docx-preview.js library options and use the renderAsync function to render the Word file in a Container DIV.
success: function (r) {
//Convert BLOB to File object.
var doc = new File([new Uint8Array(r.Data)], r.ContentType);
//If Document not NULL, render it.
if (doc != null) {
//Set the Document options.
var docxOptions = Object.assign(docx.defaultOptions, {
useMathMLPolyfill: true
});
//Reference the Container DIV.
var container = document.querySelector("#word-container");
//Render the Word Document.
docx.renderAsync(doc, container, null, docxOptions);
}
}
Best regards,
Lan Huang
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.