| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374 |
- <script type="text/javascript" src="http://47.99.98.85:8232/JavaBridge/pageoffice.js"></script>
- <?php
- header("Content-type:text/html; charset=utf-8");//设置当前页面编码为“utf-8”
- ini_set("display_errors","On");
- error_reporting(E_ALL);
- $ip = GetHostByName($_SERVER['SERVER_NAME']); //获取本机IP
- //******************************卓正PageOffice组件的使用*******************************
- require_once("http://".$ip.":8232/JavaBridge/java/Java.inc");//此行必须
- $PageOfficeCtrl = new Java("com.zhuozhengsoft.pageoffice.PageOfficeCtrlPHP");//此行必须
- $PageOfficeCtrl->setServerPage("http://".$ip.":8232/JavaBridge/poserver.zz");//此行必须,设置服务器页面
- //添加自定义按钮
- $PageOfficeCtrl->addCustomToolButton("保存","Save",1);
- $PageOfficeCtrl->addCustomToolButton("打印设置","PrintSet",0);
- $PageOfficeCtrl->addCustomToolButton("打印","PrintFile",6);
- $PageOfficeCtrl->addCustomToolButton("全屏/还原", "IsFullScreen", 4);
- $PageOfficeCtrl->addCustomToolButton("-", "", 0);
- $PageOfficeCtrl->addCustomToolButton("关闭","Close",21);
- //设置保存页面
- $PageOfficeCtrl->setSaveFilePage("./SaveFile.php");
- //打开excel文档
- $PageOfficeCtrl->UserAgent = $_SERVER['HTTP_USER_AGENT'];//若使用谷歌浏览器此行代码必须有,其他浏览器此行代码可不加
- $OpenMode = new Java("com.zhuozhengsoft.pageoffice.OpenModeType");
- $PageOfficeCtrl->webOpen($_GET['doc'], $OpenMode->docNormalEdit, "张三");//此行必须
- ?>
- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
- <html>
- <head>
- <title>卷烟包装材料安全卫生检 测 报 告-浙江美浓世纪集团有限公司检测中心</title>
- </head>
- <body>
- <script type="text/javascript">
- function Save() {
- document.getElementById("PageOfficeCtrl1").WebSave();
- }
- function PrintSet() {
- document.getElementById("PageOfficeCtrl1").ShowDialog(5);
- }
- function PrintFile() {
- document.getElementById("PageOfficeCtrl1").ShowDialog(4);
- }
- function Close() {
- //alert(document.getElementById("PageOfficeCtrl1").Document.ProtectionType );
- window.external.close();
- }
- function IsFullScreen() {
- document.getElementById("PageOfficeCtrl1").FullScreen = !document.getElementById("PageOfficeCtrl1").FullScreen;
- }
- //文档关闭前先提示用户是否保存
- function BeforeBrowserClosed(){
- if (document.getElementById("PageOfficeCtrl1").IsDirty){
- if(confirm("提示:文档已被修改,是否继续关闭放弃保存 ?"))
- {
- return true;
- }else{
- return false;
- }
- }
- }
- </script>
- <form id="form1" >
- <div style=" width:auto; height:700px;">
- <?php echo $PageOfficeCtrl->getDocumentView("PageOfficeCtrl1") ?>
- </div>
- </form>
- </body>
- </html>
|