百度文库和豆丁网的在线文档阅读功能

参考:http://suvk.blog.sohu.com/159274256.html
先把想要在线阅读的文档转换成swf格式,再用flash读取转换后的swf文件即可实现在线阅读功能。
播放器及组件下载地址:
http://code.google.com/p/flexpaper/downloads/list
下载JODConverter:
http://sourceforge.net/projects/jodconverter/files/
利用jodconverter将doc转成pdf的例子:
将jodconverter的lib下的jar加入到classpath。
百度文库和豆丁网的在线文档阅读功能 - qincidong - qincidong的博客
FileConverter.java代码:
import java.io.File;import java.net.ConnectException;
import com.artofsolving.jodconverter.DocumentConverter;
import com.artofsolving.jodconverter.openoffice.connection.OpenOfficeConnection;
import com.artofsolving.jodconverter.openoffice.connection.SocketOpenOfficeConnection;
import com.artofsolving.jodconverter.openoffice.converter.OpenOfficeDocumentConverter;

public class FileConverter {
/*** @param args*/
public static void main(String[] args) {
	// TODO Auto-generated method stub
	// 1.doc转成pdf
	File docInputFile = new File("F:\\PowerDesigner\\PowerDesigner建模实例\\课件\\PD和rose比较.doc");
	File pdfOutputFile = new File("F:\\PowerDesigner\\PowerDesigner建模实例\\课件\\PD和rose比较.pdf");
	// connect to an OpenOffice.org instance running on port 8100
	OpenOfficeConnection connection = new SocketOpenOfficeConnection(8100);
	try {
		connection.connect();
	} catch (ConnectException e) {
		// TODO Auto-generated catch block
		e.printStackTrace();
	}
	// convert
	DocumentConverter converter = new OpenOfficeDocumentConverter(connection);
	converter.convert(docInputFile, pdfOutputFile);connection.disconnect();
	}
} 
说明:这个转换需要安装有openoffice。下载swftools,将pdf转成swf。
http://www.oschina.net/p/swftools
最后利用flexplayer播放器就可以了。
  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值