public class PDFUtil extends Object
| 构造器和说明 |
|---|
PDFUtil() |
| 限定符和类型 | 方法和说明 |
|---|---|
static int |
getPageNum(String src)
获取PDF总页数
|
private static org.apache.pdfbox.pdmodel.PDDocument |
getPDDocument(String src) |
static BufferedImage |
toImg(String src,
int page)
PDF转图片 根据页码一页一页转
|
static void |
toImgOutputStream(OutputStream os,
String src,
int page,
String imgType)
PDF转图片 根据页码一页一页转,写入输出流
|
public static int getPageNum(String src) throws IOException
IOExceptionpublic static BufferedImage toImg(String src, int page) throws IOException
IOExceptionpublic static void toImgOutputStream(OutputStream os, String src, int page, String imgType) throws IOException
IOException - imgType:转换后的图片类型 jpg,pngprivate static org.apache.pdfbox.pdmodel.PDDocument getPDDocument(String src) throws IOException
IOExceptionCopyright © 2024. All rights reserved.