Giter Site home page Giter Site logo

wopihost's Introduction

wopihost

GitHub release GitHub license

English

项目介绍

基于 wopi 协议开发的 WopiHost , 支持 word, excel,ppt, pdf(仅支持预览)等文档的预览和编辑。

运行环境

需要安装 Office online 2016 才可以使用,基于jdk 1.8,spring boot开发。

使用方法

在 application.properties 中配置文档的存储路径

file.path=E:\\

接口访问地址

http://[owas.domain]/hosting/discovery
打开上面的URL, 可以看到结果如下的XML文件,上面有对应的文件类型的请求路径。
请求路径

word文档预览 http://[owas.domain]/wv/wordviewerframe.aspx?WOPISrc=http://[WopiHost.IP]:8080/wopi/files/test.docx word view

word文档编辑
http://[owas.domain]/we/wordeditorframe.aspx?WOPISrc=http://[WopiHost.IP]:8080/wopi/files/test.docx word edit

excel预览
http://[owas.domain]/x/_layouts/xlviewerinternal.aspx?ui=zh-CN&rs=zh-CN&WOPISrc=http://[WopiHost.IP]:8080/wopi/files/test.xlsx

excel编辑
http://[owas.domain]/x/_layouts/xlviewerinternal.aspx?edit=1&WOPISrc=http://[WopiHost.IP]:8080/wopi/files/test.xlsx

ppt预览 http://[owas.domain]/p/PowerPointFrame.aspx?PowerPointView=ReadingView&WOPISrc=http://[WopiHost.IP]:8080/wopi/files/test.pptx

ppt编辑
http://[owas.domain]/p/PowerPointFrame.aspx?PowerPointView=EditView&WOPISrc=http://[WopiHost.IP]:8080/wopi/files/test.pptx

备注:[owas.domain] 是 Office online 2016 的地址,[WopiHost.IP]是 WopiHost 服务的 IP 地址。 使用时替换成自己相应的服务地址。

常见问题

  • word 文档编辑支持 .docx 格式,不支持 .doc 。
  • pdf 仅支持预览,不支持编辑。
  • 如果 wopihost 的接口没有问题,但是不能预览或者编辑文档
    可能 wopi 和 Office Web Apps Server 之间的网络不能互通,也可能 Office Web Apps Server 配置有问题,建议检查配置或者重装后重试。
  • 不能打开中文名的文件,提示 Unable to Open the File
    将文件名使用 URLEncoder.encode 进行两次编码。例如:测试.xlsx, 编码为 %25E6%25B5%258B%25E8%25AF%2595.xlsx 即可正常预览、编辑。
  • 因为 office 的 BUG, 更新docx文件时 unlockAndRelock 和 putfile 请求中 header 中的锁不一致,因此在处理更新docx请求时,不去校验lock是否一致,否则无法保存docx更改。

License

MIT License

wopihost's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

wopihost's Issues

Error while opening the file.

I've connected WOPI to the blob storage successfully. Everything appears to be in order from my end, but upon opening, I encounter a persistent issue. I've tested various file types, yet the problem persists across all of them. Any thoughts on what might be causing this?

image

access_token怎样安全传输到服务端

http://【IP】/we/wordeditorframe.aspx?WOPISrc=http://【IP】:8080/zzpt/wopi/files/test4.docx&access_token=123
这种方式是可以进行传输的,但是会存在风险,有没有其他方式进行传输的?

你好,可以认识一下吗?

你好,我看到你的帖子,过来向您请教一下office webapp 的一些问题,今天我刚把服务器搭建好了,就是不知道如何 怎么在线预览文件

可以预览,但无法编辑

docx,预览是正常的,但到编辑页时,显示“抱歉,您无权编辑此文档”,不知道您是否有遇到过相似问题。

Edit in browser

please add "Edit in browser "
now this option is not enabled,
at least tell me know how to enable this option. of course I know for enabling this button we have to set this properties (UserCanWrite, HostEditUrl, HostViewUrl, EditModePostMessage) but it doesn't work.
please help

是否可以保存到服务器

请问作者,当对ppt进行预览,编辑,保存的时候,是否可以把编辑过后的ppt保存到服务器

收费问题

实现在线编辑接口要收费吗,方便给一下接口网址吗

xlsx无法在线预览,但是在线编辑正常

您好,使用x/_layouts/xlviewerinternal.aspx?ui=zh-CN&rs=zh-CN&WOPISrc=此地址无法正常预览xlsx文件
image
但是在线编辑是可以正常使用的,请问这有办法解决吗,谢谢!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.