JAVA中将Excel转为图片,现在比较好的方式可以使用aspose来处理
aspose是个比较好用插件,可以将Excel,PDF,Word互相转换,也可以转为图片,下面是使用破解版的aspose将Excel转为图片的代码,
需要用到的jar包: aspose-cells-18.9.jar
/**
* 校验license
*/
private boolean getLicense(){
boolean result = false;
//获取当前线程的类加载器
ClassLoader loader = Thread.currentThread().getContextClassLoader();
try {
//获取凭证文件的路径并读取到license
license = new FileInputStream(loader.getResource("license.xml").getPath());
//读取excel
fis = new FileInputStream(loader.getResource("test.xlsx").getPath());
License aspose = new License();
aspose.setLicense(license);
result = true;
} catch (FileNotFoundException e) {
e.printStackTrace();
}