仿百度文库解决方案(四)——利用JODConverter调用OpenOffice.org服务转换文档为PDF:
http://www.cnblogs.com/luckyxiaoxuan/archive/2012/06/14/2549012.html
JodConverter参考文档
http://code.google.com/p/jodconverter/wiki/GettingStarted
S W F T o o l s 使 用 说 明
http://wenku.baidu.com/view/bfed361152d380eb62946d8f.html
PDF2SWF简单使用
http://www.cnblogs.com/liver.wang/archive/2011/10/19/pdf2swf.html
openoffice下载地址:
http://www.openoffice.org/download/index.html
jodconverter
2.x 版本: maven仓库地址:
http://search.maven.org/#search%7Cga%7C1%7Cjodconverter
3.x版本下载:
import java.io.File;
import org.artofsolving.jodconverter.OfficeDocumentConverter;
import org.artofsolving.jodconverter.office.DefaultOfficeManagerConfiguration;
import org.artofsolving.jodconverter.office.OfficeConnectionProtocol;
import org.artofsolving.jodconverter.office.OfficeManager;
public class Test {
/**
* @param args
*/
public static void main(String[] args) {
OfficeManager officeManager = new DefaultOfficeManagerConfiguration()
.setOfficeHome("C:/Program Files/OpenOffice.org 3")
.buildOfficeManager();
try{
officeManager.start();
OfficeDocumentConverter converter = new OfficeDocumentConverter(officeManager);
converter.convert(new File("d:/test2.ppt"), new File("d:/test.pdf"));
}catch (Exception e) {
e.printStackTrace();
}finally{
officeManager.stop();
}
}
}