/**
* 获取PDF页数
* */
public static int getPDFPage(String cPath) {
int pageNumber = 0;
try {
PDDocument pdDocument = PDDocument.load(new File(cPath));
pageNumber = pdDocument.getNumberOfPages();
log.info("进入的genePDFBean:{}",pageNumber);
pdDocument.close();
} catch (Exception e) {
e.printStackTrace();
log.info("获取PDF页数失败!");
}
return pageNumber;
}
Java获取PDF文件页数
最新推荐文章于 2024-07-16 04:45:27 发布