Spire.XLS for Java是专业的Java Excel API,使开发人员无需使用Microsoft Office或Microsoft Excel即可创建,管理,操作,转换和打印Excel工作表。
本文将演示如何在Java应用程序中使用Spire.XLS for Java将Excel转换为SVG流。下载Spire.XLS最新版
代码如下:
import com.spire.xls.*; import java.io.FileOutputStream; import java.util.List; import java.util.Map; public class ExceltoSVG { public static void main(String[] args) throws Exception { //Load the sample document Workbook workbook = new Workbook(); workbook.loadFromFile("Sample.xlsx"); int count = 1; //Get the page split info. List> pageInfoList = workbook.getSplitPageInfo(); for (int i = 0; i < workbook.getWorksheets().getCount(); i++) { FileOutputStream stream; Worksheet sheet