Workbook workbook = new Workbook();
workbook.loadFromStream(ossObject.getObjectContent());
WorksheetsCollection worksheetsCollection = workbook.getWorksheets();
OSSObject zhangImage = OSSUtil.getObject(zhangPath, zhangName);
Worksheet sheet1 = worksheetsCollection.get(0);
sheet1.getPictures().add(33, 7, “C:\\\\Users\\\\lijs\\\\Desktop\\\\zhang.png”, 10, 10, ImageFormatType.Png);
sheet1.getPageSetup().setPaperSize(PaperSizeType.PaperA4);
Worksheet sheet2 = worksheetsCollection.get(1);
sheet2.getPictures().add(30, 7, “C:\\\\Users\\\\lijs\\\\Desktop\\\\zhang.png”, 10, 10, ImageFormatType.Png);
sheet2.getPageSetup().setPaperSize(PaperSizeType.PaperA4);
//workbook.getConverterSetting().setSheetFitToPage(true);
/*workbook.saveToFile(“D:\\\\TEST.pdf”, FileFormat.PDF);*/
//workbook.getConverterSetting().setSheetFitToWidth(true);
workbook.saveToStream(byteArrayOutputStream, FileFormat.PDF);
workbook.dispose();
效果图见附件