java实现在线预览doc,txt,ppt,xls等文档,用到了libreOffice,openOffice,SWFTools,JODConverter,flexPaper

本文档介绍了如何使用Java结合libreOffice、openOffice进行doc、txt、ppt、xls等文档的转换,以及通过SWFTools将PDF转换为SWF格式,最后利用FlexPaper实现在线预览。示例代码展示了具体的转换过程,包括libreOffice和openOffice的转换方法,以及如何生成和配置HTML页面以展示预览内容。
摘要由CSDN通过智能技术生成

涉及到的图片请看附件。

libreOffice转换的代码:

public String doDocToFdpLibre() {

// File inputFile = new File("d:/1.txt");
// File inputFile = new File("d:/ppt.ppt");
// File inputFile = new File("d:/pptx.pptx");
// File inputFile = new File("d:/doc.doc");
// File inputFile = new File("d:/docx.docx");
// File inputFile = new File("d:/xls.xls");
File inputFile = new File("d:/jpg.jpg");
// File inputFile = new File("d:/gif.gif");
System.out.println("libreOffice
开始转换..............................");
Long startTime = new Date().getTime();
// 
// txt:
使用libreOffice来转换pdf,转换成功,但是中文有乱码!!!!!
// doc:
这是office中的doc文档,可以转换成功,并且中文没有乱码
//docx:
这是office中的docx文档,可以转换成功,并且中文没有乱码
//ppt
pptx:转换成功。
//xls:
转换成功,没有中文乱码
//xlsx
:转换成功
//jpg
png:成功
String libreOfficePath = "D:/Program Files (x86)/LibreOffice 4";
//
此类在jodconverter3版本中存在,在2.2.2版本中不存在
DefaultOfficeMana

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值