`

bboss libreoffice结合使用说明

阅读更多
bboss libreoffice结合使用说明已经文件下载插件完善
最近增加工具类/bboss-plugin-wordpdf/src/org/frameworkset/http/converter/wordpdf/FileConvertor.java
通过jodconvertor组件结合,利用libreoffice实现word模板书签和值合并功能
方便地借助swftool和Flashprinter实现word向pdf,swf的转换

o 文件下载插件增加对FileBlob的支持
FileBlob增加构造函数:
public FileBlob( File data,int rendtype)
public FileBlob( String file,int rendtype)
两个构造函数含义是一致的,参数说明:
第一个参数:下载或者浏览的文件对象或者文件路径
第二个参数:标识文件是用来下载还是用来浏览,对应于FileBlob中的两个常量:FileBlob.BROWSER,FileBlob.DOWNLOAD,默认值为FileBlob.DOWNLOAD

使用实例一,控制器下载文件方法

public @ResponseBody FileBlob downloadSWFTempAllUseOpenOffice() throws Exception  {
		System.out.println("--------------程序执行到此处------------------");
		String[] bookMarks = new String[] { "DealerName", "Name", "CgName",
				"TypeName", "OrderQty", "CoolCode", "ChassisCode", "CustPrice",
				"CustAmt", "sumall", "EarnestPayDays", "EarnestAmt",
				"StageDate", "FirstAmt", "DepositPercent", "Deposit",
				"ServiceChargePercent", "ServiceCharge", "NotarizationFee",
				"InsuranceTerm", "Insurance", "ReinsuranceDeposit",
				"FinanceAmt", "FinanceFC", "LackAmtPayDate",
				"LackAmtFinalPayDate", "ReceiverName", "ReceiverID",   
				"ReceiverTel", "Insurer","authoriate" };
		String[] mapValue = new String[] { "工程机械有限公司", "工程机械有限公司",
				"六桥车", "xxx52E(6)", "2", "风冷", "V09660ffff", "300.00",
				"600.00", "陆万元整", "7", "100", "2000年8月31日", "60", "5", "3",
				"10", "6", "10", "5", "10", "21", "540", "10", "2000年8月31日",
				"2000年8月31日", "xxx", "430111199910102121", "13800138200", "xxxxx","bboss" };
		String hetongbianhao = "20121222";
	    String wordtemplate = "/opt/tomcat/wordpdf/anjie.doc";
	    String pdfpath = "/opt/tomcat/test/anjieswftools_" + hetongbianhao + ".pdf";
	    String wordfile = "/opt/tomcat/test/anjie_testswftools" + hetongbianhao + ".doc";
	    String toswfpath = "/opt/tomcat/test/contractswftools_" + hetongbianhao + ".swf";

		String officeHome = "/opt/LibreOffice 3.6/";
		File f = new File(toswfpath);
		if(!f.exists())
		{

			FileConvertor.init( officeHome);
						
			FileConvertor.getRealWordByOpenoffice(wordtemplate, wordfile,bookMarks, bookdatas);
			FileConvertor.wordToPDFByOpenOffice(wordfile, pdfpath);
			FileConvertor.swftoolsConvert(swftoolWorkDir, pdfpath, toswfpath);
			
		}		
		FileBlob fileblob = new FileBlob(toswfpath,FileBlob.DOWNLOAD);
		return fileblob;
		
		

	}	

实例二,结合wordpdfswf插件生成swf文件并在界面上展示
public @ResponseBody FileBlob getSWFTemp() throws Exception  {
		System.out.println("--------------程序执行到此处------------------");
		String[] bookMarks = new String[] { "DealerName", "Name", "CgName",
				"TypeName", "OrderQty", "CoolCode", "ChassisCode", "CustPrice",
				"CustAmt", "sumall", "EarnestPayDays", "EarnestAmt",
				"StageDate", "FirstAmt", "DepositPercent", "Deposit",
				"ServiceChargePercent", "ServiceCharge", "NotarizationFee",
				"InsuranceTerm", "Insurance", "ReinsuranceDeposit",
				"FinanceAmt", "FinanceFC", "LackAmtPayDate",
				"LackAmtFinalPayDate", "ReceiverName", "ReceiverID",   
				"ReceiverTel", "Insurer","authoriate" };
		String[] mapValue = new String[] { "工程机械有限公司", "工程机械有限公司",
				"六桥车", "xxx", "2", "风冷", "V09660", "300.00",
				"600.00", "陆万元整", "7", "100", "2000年8月31日", "60", "5", "3",
				"10", "6", "10", "5", "10", "21", "540", "10", "2000年8月31日",
				"2000年8月31日", "xxx", "430111199910102121", "13800138200", "xxx","bboss" };
		String hetongbianhao = "20121222";
	    String wordtemplate = "/opt/tomcat/wordpdf/anjie.doc";
	    String pdfpath = "/opt/tomcat/test/anjieswftools_" + hetongbianhao + ".pdf";
	    String wordfile = "/opt/tomcat/test/anjie_testswftools" + hetongbianhao + ".doc";
	    String toswfpath = "/opt/tomcat/test/contractswftools_" + hetongbianhao + ".swf";

		String officeHome = "/opt/LibreOffice 3.6/";
		File f = new File(toswfpath);
		if(!f.exists())
		{

			FileConvertor.init( officeHome);
						
			FileConvertor.getRealWordByOpenoffice(wordtemplate, wordfile,bookMarks, bookdatas);
			FileConvertor.wordToPDFByOpenOffice(wordfile, pdfpath);
			FileConvertor.swftoolsConvert(swftoolWorkDir, pdfpath, toswfpath);
			
		}		
		FileBlob fileblob = new FileBlob(toswfpath,FileBlob.BROWSER);
		return fileblob;
		

	}

注意我们这里使用了bboss 的word转pdf、swf插件FileConvertor
我们看看怎样通过FlashPlayer来展示生成的swf文件:
<%@ page contentType="text/html; charset=utf-8"%>
<html>
<head>
<title></title>
</head>
<body marginwidth="0" marginheight="0">
	
<embed height="100%" width="100%" name="plugin" src="getSWFTemp.page"
				type="application/x-shockwave-flash">
</body>
</html>

其中的src="getSWFTemp.page"就对应实例三中的控制器方法。
分享到:
评论

相关推荐

    bboss mvcdemo 下载地址

    在“bboss mvc开发手册.doc”中,我们可能会找到关于如何使用BBoss MVCDemo进行开发的详细指南。 首先,让我们深入了解BBoss MVCDemo的核心特性: 1. **模型(Model)**:BBoss MVCDemo支持多种数据访问方式,如JDBC...

    bboss会话共享培训文档

    文档还指出,实际应用环境中,这两种模式往往结合使用,每个应用本身采用集群部署模式,并利用跨域跨应用模式实现不同应用之间的SSO。bboss会话共享还支持跨根域系统之间的SSO,通过使用统一令牌系统。 最后,bboss...

    bboss ioc配置文件中使用外部属性文件介绍

    除了`&lt;property-placeholder&gt;`标签,BBoss还支持使用`&lt;context:property-placeholder&gt;`标签,它是Spring框架的一部分,也可以与BBoss集成使用。这种方式的配置类似,但提供了更多的选项,如默认值、忽略未定义的属性...

    springboot整合bboss es增删改查测试demo代码

    本实例是一个基于bboss es spring boot starter的demo maven工程,可供spring boot项目集成bboss elasticsearch rest client参考 展示了通过spring boot管理单集群功能和管理多集群功能 单集群测试用例:...

    bboss-elasticsearch开发环境搭建和开发入门视频教程.

    2. **bboss elasticsearch开发入门教程.wmv**: 通过实例演示,讲解如何使用BBoss进行索引操作、数据插入、查询和更新,帮助初学者快速上手。 **六、资料阅读** "说明.txt" 文件可能包含了关于这些教程的详细步骤和...

    企业级J2EE开源框架bboss

    BBoss(全称为bbossgroups)是一个专为企业级J2EE应用设计的开源框架,它为Java开发者提供了一系列强大的工具和服务,以简化Web应用程序的开发过程。该框架旨在提高开发效率,降低维护成本,同时保持高度的灵活性和...

    bboss+es基本操作示例.zip

    结合bboss和Elasticsearch,开发者可以轻松实现日志实时分析、用户行为追踪、商品推荐等业务场景,通过DSL实现复杂查询和聚合分析,提升应用的数据处理能力。 总之,bboss+es基本操作示例是学习和实践Elastic...

    springboot集成ElasticsearchBboss调用Elasticsearch.md

    springboot集成ElasticsearchBboss调用Elasticsearch的案例分享

    由 bboss 开源的数据采集&流批一体化工具,提供数据采集、数据清洗转换处理和数据入库以及数据指标统计计算流批一体化处理功能

    **bboss-datatran** 是一个由 **bboss** 社区开源的高效数据处理工具,专注于数据采集、数据清洗转换以及数据入库等任务。...通过深入学习和使用bboss-datatran,用户可以提升数据处理效率,更好地挖掘数据的价值。

    bboss elasticsearch-5.7.8.rar

    3. `bboss-util-5.5.0.jar`和`bboss-persistent-5.5.0.jar`:这是BBoss框架的核心组件,提供了许多实用工具类和持久化操作支持,如数据库连接、事务管理等,为Elasticsearch的数据导入提供底层支持。 4. `...

    bboss-db-elasticsearch-tool-master_java_

    压缩包中的`db-elasticsearch-tool`可能包含了框架的核心库、示例代码、文档和配置文件,帮助用户快速理解和使用这个框架。通过阅读源码、查看示例和文档,开发人员可以深入理解BBoss-DB-Elasticsearch-Tool的工作...

    bboss 安全认证过滤器功能介绍

    3. **销毁清理**:当应用关闭或过滤器不再使用时,`destroy()`方法会被调用,用于清理资源。 在BBoss框架中,安全认证通常涉及以下步骤: 1. **用户登录**:用户通过提交用户名和密码发起登录请求,服务器验证这些...

    基于bboss新版平台项目环境搭建和代码工具使用视频教程.rar

    "基于bboss新版平台项目环境搭建和代码工具使用视频教程"提供了一套详细的指导,旨在帮助开发者快速掌握bboss新版本平台的相关操作。bboss,全称为Business Basic Open Source,是一个开源的企业级开发框架,它为...

    bboss persistent 1.0.2中方便地实现大字段(clob,blob)的处理

    BBoss Persistent是一个轻量级的持久层框架,它提供了方便的方式来处理这些大字段。本文将深入探讨在BBoss Persistent 1.0.2中如何高效地管理CLOB和BLOB数据。 首先,CLOB用于存储大量的文本数据,如长篇文章或XML...

    bboss+easyui帮助文档比较详细

    结合BBoss和EasyUI,开发者可以在后端使用BBoss进行业务逻辑的处理和数据管理,同时在前端利用EasyUI创建美观的用户界面。这种组合方式可以有效地提升开发效率,降低项目开发的复杂度,并确保应用具有良好的用户体验...

    bboss会话共享培训文档分享

    部署模式涉及到bbosssession在不同环境下的应用,包括如何结合使用诸如apache、nginx、lvs、haproxy等高可用负载技术,以及如何在不同版本的容器中部署。bbosssession支持灵活的部署模式,以适应不同的业务需求和...

    bboss-soa.jar

    官方版本,亲测可用

    bboss-elastic-tran:bboss 数据同步工具

    弹性Tran老板数据交换模块使用文档: : Bboss是一个很好的Elasticsearch Java Rest客户端。 它运行并访问像mybatis这样的elasticsearch来关联数据库。环境要求JDK要求:JDK 1.7+ Elasticsearch版本要求:1.X,2.X,5...

Global site tag (gtag.js) - Google Analytics