在线预览doc文档html代码,WDA: 配合openoffice实现文档的在线预览,实现本地文档添加,文档转换为html,文档HTML方式预览,可以实现预览的文档:doc、docx、ppt、pptx...

WDA v1.2.5

支持浏览器上传附件进行预览,支持mp3在线播放

**

07df6099c5fc8a61658c85ed5d72a0df.png 注意:与开源版WCP集成请选用v1.2.2版本,新版本不保证兼容WCP**

使用方式

注意

在web-inf/lib下是项目依赖的jar,有些jar文件需要手动导入

需要在服务器上安装openoffice服务,测试环境使用的是openoffice4,启动wda服务器注意先在config.properties中配置openoffice4的启动命令

配置文件docTypeConf.xml

ec4fa0047644b5c129399e275b64ca98.png

conf/files:被转换为的文件类型 exname为支持的文件类型名称 filename为生成文件名filename的path参数为文件相对路径

conf/types:文件转换关系对照

conf/types/name:源文件后缀名

conf/types/target:目标文件类型,可以生成多种,需要与conf/files/file/exname一致/

配置文件config.properties

745fc9a9589f9edfcb41c9ab7f0943fe.png

config.file.dir.path:文件存储地址,需要配置到webroot下

config.server.openoffice.cmd:openoffice的soffice服务启动命令

config.rmi.port:rmi绑定端口

RMI调用

WdaAppInter personService = (WdaAppInter) Naming.lookup("rmi://127.0.0.1:8888/wda");

personService.generateDoc("1234", new File("D:\\doc\\1.docx"));

com.farm.wda.inter.WdaAppInter

/**

* 开始生产WEB文档

*

* @param key

* 文档关键字,后续通过它调用相关资源

* @param file

* 原文件

* @param htmlinfo

* 被显示的html信息(如文件名称等)

* @throws ErrorTypeException

* @throws RemoteException

*/

public void generateDoc(String key, File file, String htmlinfo) throws ErrorTypeException, RemoteException;

/**

* 开始生产WEB文档

*

* @param key

* 文档关键字,后续通过它调用相关资源

* @param file

* 原文件

* @param fileTypeName

* 扩展名

* @param htmlinfo

* 被显示的html信息(如文件名称等)

* @throws ErrorTypeException

* @throws RemoteException

*/

public void generateDoc(String key, File file, String fileTypeName, String htmlinfo)

throws ErrorTypeException, RemoteException;

/**

* 获得可以被转换的文件类型

*

* @return

*/

public Set getSupportTypes() throws RemoteException;

/**

* 文档是否已经生成完毕

*

* @param key

* @return

* @throws ErrorTypeException

*/

public boolean isGenerated(String key, String doctype) throws ErrorTypeException, RemoteException;

/**

* 文档是否有日志记录

*

* @param key

* @return

* @throws ErrorTypeException

*/

public boolean isLoged(String key) throws RemoteException;

/**

* 删除日志(通过日志判断是否生成过文档时,可以通过此方法重新生成文档)

*

* @param key

* @return

* @throws ErrorTypeException

*/

public void delLog(String key) throws RemoteException;

/**

* 获得日志地址

*

* @param key

* @return

*/

public String getlogURL(String key) throws RemoteException;

/**

* 获得文档文本字符串

*

* @param key

* @return

* @throws ErrorTypeException

*/

public String getText(String key) throws ErrorTypeException, RemoteException;

/**

* 获得文档信息字符串

*

* @param key

* @return

* @throws ErrorTypeException

*/

public String getInfo(String key) throws ErrorTypeException, RemoteException;

/**

* 获得在线文档浏览的URL

*

* @param key

* @param exname

* @return

* @throws ErrorTypeException

*/

public String getUrl(String key, String docType) throws ErrorTypeException, RemoteException;

演示

演示地址:[http://www.wcpdoc.com/webspecial/home/Pub2c909b2b65e0f2850165e0fb5600002a.html)

在wcp中集成了wda的功能,通过wcp的连接展示wda系统

8f21fe574b5026c87a0817de61ff913a.png

如图,点击预览后进入wda系统

48cdd4eeabbd14bb9819ece98766e581.png

开源项目推荐

商业版产品介绍

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值