Model.Attchment contains the byte[] of the document. It comes to the client side with my script, but not displayed in the Document Editor.
This is the script I’m using :
`
var base64Content = “@Html.Raw(Convert.ToBase64String(Model.Attachment))”;
var documentEditor = new ej.documenteditor.DocumentEditor({
isReadOnly: false
});
documentEditor.appendTo('#documenteditor_titlebar');
// Function to load the document into the Document Editor
function loadDocument() {
documentEditor.open({
document: {
fileContent: base64Content,
fileName: "document.docx",
fileType: "Docx",
}
});
}
// Load the document when the DOM content is fully loaded
document.addEventListener("DOMContentLoaded", function () {
loadDocument();
});
`