| | |
| | | //存储图片信息及所在分页 |
| | | Map<Integer,PictureData> pictureDataMap = new HashMap<>(); |
| | | if(excelType == 1){ //.xls |
| | | List<HSSFShape> children = ((HSSFSheet) sheet).getDrawingPatriarch().getChildren(); |
| | | HSSFPatriarch drawingPatriarch = ((HSSFSheet) sheet).getDrawingPatriarch(); |
| | | if(drawingPatriarch!=null) { |
| | | List<HSSFShape> children = drawingPatriarch.getChildren(); |
| | | for (HSSFShape child : children) { |
| | | HSSFPicture picture = (HSSFPicture)child; |
| | | HSSFPictureData pictureData = picture.getPictureData(); |
| | |
| | | } |
| | | } |
| | | } |
| | | } |
| | | else if(excelType == 2){ //.xlsx |
| | | List<XSSFShape> children = ((XSSFSheet) sheet).getDrawingPatriarch().getShapes(); |
| | | XSSFDrawing drawingPatriarch = ((XSSFSheet) sheet).getDrawingPatriarch(); |
| | | if(drawingPatriarch!=null) { |
| | | List<XSSFShape> children = drawingPatriarch.getShapes(); |
| | | for (XSSFShape child : children) { |
| | | XSSFPicture picture = (XSSFPicture)child; |
| | | XSSFPictureData pictureData = picture.getPictureData(); |
| | |
| | | } |
| | | } |
| | | } |
| | | } |
| | | Set<Integer> pictureRowSet = new HashSet<>(); |
| | | if(!pictureDataMap.isEmpty()) { |
| | | pictureRowSet = pictureDataMap.keySet(); |