onlyoffice转换html,onlyoffice/documentServer在线编辑保存

启动一个documentServer的容器

docker run -it --name documentServer -d -p 9090:80 onlyoffice/documentserver

首先实现前端预览功能

Title

var docEditor = new DocsAPI.DocEditor("placeholder", {

"document": {

"fileType": "docx",

"permissions": {

"edit": false,

},

"key": "C8D7FB890BAC496FB0D27B163EDB88BDAA",

"title": "zf张飞.docx",

"url": "文件下载接口",

},

"height": "1000px",

"width": "100%"

});

我们在config配置了callbackUrl,文档加载时会调用这个接口,此时status = 1,我们给onlyoffice的服务返回{"error":"0"}的信息,这样onlyoffice会认为回调接口是没问题的,这样就可以在线编辑文档了,否则的话会弹出窗口说明

The document could not be saved. Please check connection settings or contact your administrat

你可能感兴趣的:(onlyoffice转换html,onlyoffice/documentServer在线编辑保存)