Thread ID: |
Created: |
Updated: |
Platform: |
Replies: |
143030 | Mar 1,2019 06:16 AM UTC | Dec 5,2020 09:24 PM UTC | JavaScript - EJ 2 | 3 |
![]() |
Tags: DocumentEditor |
WordDocument document = WordDocument.Load(stream, GetFormatType(type.ToLower()));
string sfdt = Newtonsoft.Json.JsonConvert.SerializeObject(document);
document.Dispose();
return sdft;
var form = document.createElement("form");
form.setAttribute('method', "post");
form.setAttribute('encType', "multipart/form-data");
var outputFileName = document.createElement("input");
outputFileName.type = "hidden";
outputFileName.name = "outputFileName";
outputFileName.value = "filename.pdf";
form.appendChild(outputFileName);
var outputFormat = document.createElement("input");
outputFormat.type = "hidden";
outputFormat.name = "outputFormat";
outputFormat.value = "pdf";
form.appendChild(outputFormat);
// save the document as blob
documentEditor.saveAsBlob('Docx').then(function (exportedDocument) {
//create a form and using existing fields
var formData = new FormData(form);
// send the file name
formData.append('fileName', 'sample.docx');
// send the blob
formData.append('data', exportedDocument);
fetch(form.action, {
method: form.method,
body: formData
}).then(function (res) {
if (!res.ok) {
console.log('something unexpected happened')
}
res.text().then(function (text) {
console.log(text);
})
})
}); |
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.
This page will automatically be redirected to the sign-in page in 10 seconds.