// Create a png file stream FileOutputStream outputStream = null; try { outputStream = new FileOutputStream("ExportShapeToImage.png"); } catch (FileNotFoundException e) { e.printStackTrace(); } // Create a new workbook Workbook workbook = new Workbook(); // Open an excel file InputStream fileStream = this.getResourceStream("xlsx/GroupShape.xlsx"); workbook.open(fileStream); IWorksheet worksheet = workbook.getWorksheets().get(0); // Export the shape to image worksheet.getShapes().get(0).toImage(outputStream, ImageType.PNG); // Close the file stream try { outputStream.close(); } catch (IOException e) { e.printStackTrace(); }