Springboot整合PageOffice 实现word在线编辑保存。

一、查看官网

http://www.zhuozhengsoft.com/

点击首页下载,进入页面:
在这里插入图片描述
最新得5.2,我们就下载5.2版本进行测试。

二、查看下载包

在这里插入图片描述

  1. Samples5 为示例文件。放入tomcat中得webapps可以直接访问。
    localhost:8080/Samples5/index.html
  2. 集成文件 里面有我们需要jar包

新建springboot项目以及简单测试这里就不多说了。

1、springboot 引入 pageoffice5.2.0.12.jar

在这里插入图片描述

2、springboot 引入thymleaf

       <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-thymeleaf</artifactId>
        </dependency>

3、编写配置文件


/**
 * PageOffice 配置类
 */
@Configuration
public class PageOfficeConfig {
   
   

    @Value("${file.save.path}")
    String poSysPath;

    /**
     * 添加PageOffice的服务器端授权程序Servlet(必须)
     * @return
     */
    @Bean
    public ServletRegistrationBean servletRegistrationBean() {
   
   
        com.zhuozhengsoft.pageoffice.poserver.Server poserver = new com.zhuozhengsoft.pageoffice.poserver.Server();
        //设置PageOffice注册成功后,license.lic文件存放的目录
        poserver.setSysPath(poSysPath);
        ServletRegistrationBean srb = new ServletRegistrationBean(poserver);
        srb.addUrlMappings("/poserver.zz");
        srb.addUrlMappings("/posetup.exe");
        srb.addUrlMappings("/pageoffice.js");
        srb.addUrlMappings("/jquery.min.js");
        srb.addUrlMappings("/pobstyle.css");
        srb.addUrlMappings("/sealsetup.exe");
        return srb;
    }

}

4、编写 index.html 和 word.html

4.1 index.html

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <!-- office插件js begin 必须引入-->
    <script 
评论 16
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值