12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485 |
- <%@page contentType="text/html" pageEncoding="UTF-8"%>
- <!DOCTYPE html>
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
- <title>office文件预览</title>
- </head>
- <%
- String path = request.getContextPath();
- String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
- %>
- <link href="<%=path%>/scripts/showLoading/showLoading.css" rel="stylesheet" type="text/css" />
- <script type="text/javascript" src="<%=path%>/scripts/qui/libs/js/jquery.js"></script>
- <script type="text/javascript" src="<%=path%>/scripts/showLoading/jquery.showLoading.js"></script>
- <script type="text/javascript" src="/nwyj/scripts/base64.js"></script>
- <%
- response.setCharacterEncoding("UTF-8");
- String fileName = request.getParameter("filePath");
- fileName = java.net.URLDecoder.decode(fileName,"UTF-8");
- %>
- <script type="text/javascript">
- var obj;
- var filePath="<%=fileName%>";
- var path="<%=basePath%>";
-
-
- $(function(){
- return;
- //$("#TANGER_OCX").css("height",$(window).height());
- obj = document.getElementById("TANGER_OCX");
- //obj.activate(true);
- // obj.EnableFileCommand(0-7) =false;
- var version = obj.GetOfficeVer();
- //alert(version);
- if(version==100){
- obj.ShowTipMessage("提示","当前电脑没有安装office,不能在线预览")
- return;
- }
- //alert(path+"upload/" +filePath);
- //obj.BeginOpenFromURL(path+"upload/"+filePath );
- //alert(1);
-
- });
- /*
- $(window).onload = function(){
- $("#TANGER_OCX").css("height",$(window).height());
- var obj = document.getElementById("TANGER_OCX");
- obj.activate(true);
- // obj.EnableFileCommand(0-7) =false;
- var version = obj.GetOfficeVer();
- alert(version);
- if(version==100){
- obj.ShowTipMessage("提示","当前电脑没有安装office,不能在线预览")
- return;
-
- }
- //alert(path+"upload/" +filePath);
- //obj.BeginOpenFromURL(path+"upload/"+filePath );
- //alert("/nwyj/upload/" +filePath);
- window.setTimeout(function(){obj.BeginOpenFromURL("/nwyj/upload/" +filePath ); }, 500);
-
- }*/
- function Init()
- {
- //obj.IsExitOfficeProcessWhenClose = true;
- obj = document.getElementById("TANGER_OCX");
- window.setTimeout(function(){obj.AddDocTypePlugin(".pdf","PDF.NtkoDocument","5.0.3.0","ntkooledocall.cab",51,true);}, 500);
- window.setTimeout(function(){obj.BeginOpenFromURL("Download.jsp?dakai="+encodeURI(encodeURI(filePath ))); }, 1000);
-
- }
- </script>
- <body onload="Init()">
- <script type="text/javascript" src="ntkoofficecontrol.js"></script>
- <script language="javascript" for="TANGER_OCX" event="OnDocumentOpened(file,doc)">
- //设置只读
- // TANGER_OCX.SetReadOnly(true,"");
- // TANGER_OCX.EnableFileCommand(0-7) = false;
- </script>
- </body>
- </html>
|