先导入words的jar包
Java实现批量将word文档转换成PDF

 

 需要jar包的私聊我发你

代码如下:
import com.aspose.words.Document;
import java.io.File;

public class WordToPdf {
public static void main(String[] args) {
try {
//doc路径
Document document = new Document("C:\\Users\\pc\\Desktop\\1335924693531.doc");
//pdf路径
File outputFile = new File("C:\\Users\\pc\\Desktop\\结果.pdf");
//操作文档保存
document.save(outputFile.getAbsolutePath(), com.aspose.words.SaveFormat.PDF);
} catch (Exception e) {
e.printStackTrace();
}
}
}

相关文章:

  • 2021-08-07
  • 2022-01-13
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-01-18
  • 2021-11-03
猜你喜欢
  • 2021-11-18
  • 2021-09-16
  • 2021-06-19
  • 2022-12-23
  • 2021-12-19
  • 2022-01-25
  • 2022-01-01
相关资源
相似解决方案