//使用架包pdfbox-1.71 fontbox-1.71
public String[] yPic(String pdfPath) {//strs是传过来的pdf文件路径
String[] str = null;//定义一个 数组,用来存放输出的图片的路径try {
InputStream is = new FileInputStream(pdfPath);
PDDocument pdf = PDDocument.load(is, true);
List<PDPage> pages = pdf.getDocumentCatalog().getAllPages();
int actSize = pages.size(); // actSize是PDP文件中实际的页数
str = new String[actSize];
for(int i =0;i<actSize;i++){//循环输出一页pdf文件转化的图片
Document document = new Document();
document.setFile(pdfPath);
float scale = 1f;
float rotation = 0f;
Page page = document.getPageTree().getPage(i);
page.init();
PDimension sz = page.getSize(Page.BOUNDARY_CROPBOX, rotation, scale);
pageHeight = (int) sz.getHeight();
pageWidth = (int) sz.getWidth();
BufferedImage image = new BufferedImage(pageWidth,
pageHeight,