Model.Attchment содержит байт[] документа. Он поступает на клиентскую сторону вместе с моим сценарием, но не отображается в редакторе документов.
Это сценарий, который я использую:
`
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();
});
Источник: https://stackoverflow.com/questions/781 ... ent-editor