1、读取PDF文件:使用PDDocument静态方法load()加载现有的PDF文档。 final PDDocument doc = PDDocument.load(pdf);

3、取得文档的页面,用PDFRenderer对象渲染图片BufferedImage, pdfRenderer.renderImageWithDPI(pageIndex, 200f, ImageType.ARGB)

5、关闭文档document对象。 doc.close();

时间:2024-10-12 21:50:55
1、读取PDF文件:使用PDDocument静态方法load()加载现有的PDF文档。 final PDDocument doc = PDDocument.load(pdf);
3、取得文档的页面,用PDFRenderer对象渲染图片BufferedImage, pdfRenderer.renderImageWithDPI(pageIndex, 200f, ImageType.ARGB)
5、关闭文档document对象。 doc.close();