word转为pdf文件
第一种:使用openoffice插件完成
缺点:只能转换真正的word文档
/**
* startFile和overFile 最好在同一个目录下
* @param startFile 源文件目录(word文件)
* @param overFile 转换的pdf文件目录
* @throws IOException
*/
public void WordToPDF(String startFile, String overFile) throws IOException {
// 源文件目录
File inputFile = new File(startFile);
if (!inputFile.exists()) {
System.out.println("源文件不存在!");
return;
}
// 输出文件目录
File outputFile = new File(overFile);
if (!outputFile.getParentFile().exists()) {
outputFile.getParentFile().exists();
}
// 调用openoffice服务线程
/** 我把openOffice下载到了 C:/Program Files (x86)/下 ,下面的写法自己修改编辑就可以**/
String OpenOfficePath =PropertiesUtil.getGlobalValueByKey("OpenOfficePath");
String command=null;
/*