/**
* word 转pdf
*
* @param source 输入文件 源 doc ,docx
* @param target 输入文件 目标 pdf
*/
public static void wordToPdf(File source, File target) {
FileOutputStream os = null;
try {
os = new FileOutputStream(target);
// Address是将要被转化的word文档
com.aspose.words.Document doc = new com.aspose.words.Document(source.getPath());
doc.save(os, SaveFormat.PDF);

} catch (Exception e) {
e.printStackTrace();
} finally {
if (os != null) {
try {
os.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}

}

相关文章:

  • 2022-02-06
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-11-14
  • 2022-12-23
  • 2021-04-10
  • 2022-12-23
  • 2022-12-23
  • 2021-11-19
  • 2022-01-01
相关资源
相似解决方案