Hi
I using WebViewer 10.3.0 to edit docx files. I load document docx from my own serwer. After edit docx i want to save changed document to loaded document on the serwer ( not a local computer). This mean i use :
initialDoc: ‘ocx/tmp/test.docx’
and a want save changest to ocx/tmp/test.docx .
How can i do this?
My code below :
var $j = jQuery.noConflict();
$j(document).ready(function () {
var obj = document.getElementById(‘viewer’);
WebViewer({
path: ‘WebViewer/lib’,
initialDoc: 'ocx/tmp/test.docx', // You can also use documents on your server
enableOfficeEditing: true,
}, document.getElementById('viewer'))
.then(instance => {
const { documentViewer, annotationManager } = instance.Core;
const Tools = instance.Core.Tools;
const Annotations = instance.Core.Annotations;
documentViewer.addEventListener('documentLoaded', () => {
});
});
});
I find another solusion. Add custom button and write code to get edited docx file and convert it to base64 string. In this way i can send this file to server-side.
Thanks for replay.
Your idea is good way. But in additionaly i need get content of file in javascript. I need a way or function in what i get doxc file in bytes for example :
val fileInArrayBytesAfterChanges = instance.UI.anyfunction()
or directly in javascript. This means reading the contents of the downloaded to local storage docx file, but I think this is impossible due to security policy