PageOffice在线预览word/excel/ppt/pdf

本文档介绍如何利用PageOffice集成Thymeleaf,在线预览Word、Excel、PPT和PDF文件。涉及步骤包括创建HTML页面、配置Thymeleaf和PageOffice许可证,添加依赖以及设置Controller层。
摘要由CSDN通过智能技术生成

因为PageOffice集成了Thymeleaf,所以需要在resources目录下新建如下页面
在这里插入图片描述
Index.html点击预览操作页面

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org"
      xmlns:sec="http://www.thymeleaf.org/thymeleaf-extras-springsecurity3">
    <head>
        <title>Index</title>
        <script type="text/javascript" src="jquery.min.js"></script>
     	<script type="text/javascript" src="pageoffice.js" id="po_js_main"></script>

    </head>
    <body>
        <h1 th:inline="text">文件预览</h1>
        <a href="javascript:POBrowser.openWindowModeless('/word?filepath=/opt/oa/enclosure/notice/1.doc','width=1200px;height=800px;');">打开文件 </a>
    </body>
</html>

Word.html预览页面

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org"
      xmlns:sec="http://www.thymeleaf.org/thymeleaf-extras-springsecurity3">
    <head>
        <title>Hello World!</title>
        <script type="text/javascript">
          	function Save() {
              	document.getElementById("PageOfficeCtrl1").WebSave();
        	}
        </script>
        <script type="text/javascript">
         function AddSeal() {
			try{
        		  document.getElementById("PageOfficeCtrl1").ZoomSeal.AddSeal();
			}catch (e){ };
        	}
  		</script>
        
    <
  • 0
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 2
    评论
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值