限制和 API 差异

公共 API 差异

以下列表(带有示例代码段)显示了 Aspose.Cells for Java 和 Aspose.Cells for Node.js via Java API 之间的一些差异。

导入库(包比较)

Aspose.Cells for Java

 import com.aspose.cells.*;

Aspose.Cells for Node.js via Java

 var aspose = aspose || {};

aspose.cells = require("aspose.cells");

实例化一个新的工作簿

Aspose.Cells for Java

 Workbook excelbook = new Workbook();

Aspose.Cells for Node.js via Java

 var excelbook = new aspose.cells.Workbook();

枚举或常量

Aspose.Cells for Java

 arc2.getLineFormat().setDashStyle(MsoLineDashStyle.SOLID);

Aspose.Cells for Node.js via Java

 arc2.getLineFormat().setDashStyle(aspose.cells.MsoLineDashStyle.SOLID);

流媒体文件

Aspose.Cells for Java

 InputStream inputstream = new FileInputStream(Book1.xlsx);

Workbook workbook = new Workbook(inputstream);

workbook.save(result.xlsx);

Aspose.Cells for Node.js via Java

 var aspose = aspose || {};

aspose.cells = require("aspose.cells");

var fs = require("fs");

var readStream = fs.createReadStream("Book1.xlsx");

aspose.cells.Workbook.createWorkbookFromStream(readStream, function(workbook, err) {

    if (err) {

        console.log("open workbook error");

        return;

    }

   workbook.save('result.xlsx');

    console.log('saved to file');

});

Aspose.Cells for Node.js via Java API 与 Aspose.Cells for Java API 相比的其他限制

  1. 不支持从 Array、ArrayList、ResultSet 等导入/导出数据。
  2. 不支持打印。