A secondary development was carried out on https://github.com/kekingcn/kkFileView/. With the integration of openOffice, the project is even larger! But it is easier to use and configure, just configure redis
Code Cloud: https://gitee.com/253281376/kkFileViewOfficeEdit.git
IP+port+project name/onlinePreview?url=your file address
http://127.0.0.1:8012/onlinePreview?url=http%3A%2F%2Flocalhost%3A8080%2F1.doc
Note that the address is passed, do not download the stream, the url needs to be encoded!
IP+port+project name/onlineEdit?url=your file address&callBack=callback address
After the document is saved successfully, a callback will be triggered. The onlineEdit method calls the callback address you passed and passes the regenerated document download address back (parameter name: downloadPath)
As an independent preview and editing service, this project adopts this method considering that it is possible that the two projects may be deployed to two different servers and the files are not interoperable.
Edit address example:
http://127.0.0.1:8012/onlineEdit?callBack=localhost:8080/ZsContent/saveCallBack&url=http%3A%2F%2Fwww.xdocin.com%2Fdemo%2Fdemo.docx&fileId=yourId
The url needs to be encoded! The callback address cannot be accompanied by http://
If there are other parameters, you can splice them behind the URL and will be passed back together during callback.
Callback address example: http://localhost:8080/ZsContent/saveCallBack?downloadPath=http://127.0.0.1:8012/download?filename=D:/Users/chenkailing/test/a3ba6f7c-a989-4f47-8173-f795ff30a92b.doc&fileId=yourId
Incompatible with chrome version 42 or above. If you need to use it, please switch to compatible mode. You cannot use the extreme speed mode.
PageOffice V4.0 Standard Edition Trial Serial Number: IMTG6-BSXJ-JGZ6-3BIWM
PageOffice V4.0 Professional Edition Trial Serial Number: CA1XB-MF7Y-12ST-PSBP2
doc editing effect
Excel preview effect
doc preview effect
zip,rar compression preview effect
Image preview effects such as png, jpeg, jpg, etc., support scroll wheel scaling, rotation, inversion, etc.
Considering the explanation of the length, we will not post the preview effect of other format files. If you are interested, you can refer to the following examples to build it.
Step 1: Pull project https://github.com/yijiusmile/kkFileViewOfficeEdit.git
Step 2: Configure the redis address, such as
#=============================================#spring Redisson配置#===================================#
spring.redisson.address = 192.168.1.204:6379
##资源映射路径(因为jar方式运行的原因)
file.dir = C:\Users\yudian\Desktop\dev\
file.dir is the actual storage address of the converted file, please note that it must end with /