使用Aspose.cells實現Excel轉換為pdf
阿新 • • 發佈:2018-12-27
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);
}
}
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();
open.close();
}
public void getConverter(String oldPath, String savePath) throws Exception {
Workbook book = new Workbook(new FileInputStream(oldPath));
book.save(savePath, SaveFormat.PDF);
}
}