bf64d23ea36ec54ac602b8044cfdc0549585a220.svn-base 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. <%@page contentType="text/html" pageEncoding="UTF-8"%>
  2. <!DOCTYPE html>
  3. <html xmlns="http://www.w3.org/1999/xhtml">
  4. <head>
  5. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  6. <title>office文件预览</title>
  7. </head>
  8. <%
  9. String path = request.getContextPath();
  10. String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
  11. %>
  12. <link href="<%=path%>/scripts/showLoading/showLoading.css" rel="stylesheet" type="text/css" />
  13. <script type="text/javascript" src="<%=path%>/scripts/qui/libs/js/jquery.js"></script>
  14. <script type="text/javascript" src="<%=path%>/scripts/showLoading/jquery.showLoading.js"></script>
  15. <script type="text/javascript" src="/nwyj/scripts/base64.js"></script>
  16. <%
  17. response.setCharacterEncoding("UTF-8");
  18. String fileName = request.getParameter("filePath");
  19. fileName = java.net.URLDecoder.decode(fileName,"UTF-8");
  20. %>
  21. <script type="text/javascript">
  22. var obj;
  23. var filePath="<%=fileName%>";
  24. var path="<%=basePath%>";
  25. $(function(){
  26. return;
  27. //$("#TANGER_OCX").css("height",$(window).height());
  28. obj = document.getElementById("TANGER_OCX");
  29. //obj.activate(true);
  30. // obj.EnableFileCommand(0-7) =false;
  31. var version = obj.GetOfficeVer();
  32. //alert(version);
  33. if(version==100){
  34. obj.ShowTipMessage("提示","当前电脑没有安装office,不能在线预览")
  35. return;
  36. }
  37. //alert(path+"upload/" +filePath);
  38. //obj.BeginOpenFromURL(path+"upload/"+filePath );
  39. //alert(1);
  40. });
  41. /*
  42. $(window).onload = function(){
  43. $("#TANGER_OCX").css("height",$(window).height());
  44. var obj = document.getElementById("TANGER_OCX");
  45. obj.activate(true);
  46. // obj.EnableFileCommand(0-7) =false;
  47. var version = obj.GetOfficeVer();
  48. alert(version);
  49. if(version==100){
  50. obj.ShowTipMessage("提示","当前电脑没有安装office,不能在线预览")
  51. return;
  52. }
  53. //alert(path+"upload/" +filePath);
  54. //obj.BeginOpenFromURL(path+"upload/"+filePath );
  55. //alert("/nwyj/upload/" +filePath);
  56. window.setTimeout(function(){obj.BeginOpenFromURL("/nwyj/upload/" +filePath ); }, 500);
  57. }*/
  58. function Init()
  59. {
  60. //obj.IsExitOfficeProcessWhenClose = true;
  61. obj = document.getElementById("TANGER_OCX");
  62. window.setTimeout(function(){obj.AddDocTypePlugin(".pdf","PDF.NtkoDocument","5.0.3.0","ntkooledocall.cab",51,true);}, 500);
  63. window.setTimeout(function(){obj.BeginOpenFromURL("Download.jsp?dakai="+encodeURI(encodeURI(filePath ))); }, 1000);
  64. }
  65. </script>
  66. <body onload="Init()">
  67. <script type="text/javascript" src="ntkoofficecontrol.js"></script>
  68. <script language="javascript" for="TANGER_OCX" event="OnDocumentOpened(file,doc)">
  69. //设置只读
  70. // TANGER_OCX.SetReadOnly(true,"");
  71. // TANGER_OCX.EnableFileCommand(0-7) = false;
  72. </script>
  73. </body>
  74. </html>