使用Aspose.cells实现Excel转换为pdf

import java.io.FileInputStream;
import java.io.InputStream;


import com.aspose.cells.License;
import com.aspose.cells.SaveFormat;
import com.aspose.cells.Workbook;


public class CellsConverter {


public CellsConverter() throws Exception {
License license = new License();
InputStream open = CellsConverter.class.getResource("license.xml").openStream();
license.setLicense(open);
open.close();
}


public void getConverter(String oldPath, String savePath) throws Exception {
Workbook book = new Workbook(new FileInputStream(oldPath));
book.save(savePath, SaveFormat.PDF);
}


}

猜你喜欢

转载自blog.csdn.net/T_amo/article/details/77245365