---
title: "关于政务版本中的公文签名及签章"
author: "man1900"
date: "2011-08-05T12:17:57Z"
tags: []
categories: ["行业应用"]
slug: "untitled"
draft: false
lastmod: "2011-08-05T12:32:34Z"
id: 1140858
url: "https://man1900.iteye.com/blog/1140858"
---

政府的很多系统都有涉及到电子签名及签章的管理功能，在joffice中，也有关于这部分的整合，先看以下的一界面：

![电子印章、签名](http://dl.iteye.com/upload/attachment/531188/fd3c7ac2-5434-3e29-9d7a-949de30ee0b7.png)

 

我们提供另一种在EXT中比较容易使用J.Office控件，可以比较方便调用这些组件以实现在线的保留修改痕迹、签名、签章等。以下我们以整合金格的iWebOffice2009组件为例：

先写一OfficePanel:

 

```
/**
 * 集成IWebOffice2009 Office控件，以方便实现签名，签章等功能
 * @class IWebOfficePanel
 * @extends Ext.Panel
 */
IWebOfficePanel=Ext.extend(Ext.Panel,{
	constructor:function(conf){
		Ext.applyIf(conf,this);
		this.initUI();
		IWebOfficePanel.superclass.constructor.call(this,{
			region:'center',
			layout:'form',
			items:[
			]
		});
		this.on('afterrender',function(){
			this.body.appendChild(this.officeObj);
			//新建文档
			this.officeObj.CreateFile();
		},this);
		
		this.on('destroy',function(){
			try{
				//文档关闭
				this.officeObj.WebClose();
			  }catch(e){
			    alert(e.description);
			  }
		},this);
	},
	initUI:function(){
		this.officeObj= document.createElement('object');
		this.officeObj.classid= "clsid:8B23EA28-2009-402F-92C4-59BE0E063499"; 
		this.officeObj.codebase = __ctxPath+'/js/core/iweboffice/iWebOffice2009.cab#version=10,3,0,0';
		this.officeObj.width = "100%";
		this.officeObj.height = "100%";
	},
	
	openDoc:function(){
		...
	},
	//签名
	sign:function(){
		...
	},
        ....
 });
```

 简单调用示例：

 

 

```
var officePanel=new IWebOfficePanel({
					region:'center'
				});
				
				var mywin=new Ext.Window({
					title:'J.Office中采用第三方Office控件及签章',
					height:600,
					width:1090,
					layout:'border',
					items:[officePanel]
				});
				
				mywin.show();
```