import com.spire.xls.Workbook;
import com.spire.xls.Worksheet;
public static void transExcelToImg(String excelPath, String imgPath){//加载Excel工作表Workbook wb = new Workbook();wb.loadFromFile(excelPath);//获取工作表Worksheet sheet = wb.getWorksheets().get(0);//调用方法将Excel工作表保存为图片wb.getConverterSetting().setXDpi(2000);wb.getConverterSetting().setYDpi(2000);sheet.saveToImage(imgPath);};
需要用到
Spire.Xls.jar