Swift API 将 WORKBOOK 导出到 JPG 文件

将 WORKBOOK 导出为 JPG 文件的 Swift 库

使用 Cells Export REST API 在 Swift 中导出电子表格内部对象工作流程。这是使用 Swift 将电子表格在线导出 WORKBOOK 到 JPG 格式文件的专业解决方案。

在 Swift 中将 WORKBOOK 对象导出为 JPG 格式文件

API
POST
https://api.aspose.cloud/v3.0/cells/export

将 WORKBOOK 对象从电子表格导出到 JPG 文件是一项复杂的任务。将 WORKBOOK 导出为 JPG 格式转换由我们的 Swift SDK 执行,同时保留源 WORKBOOK 电子表格的主要结构和逻辑内容。我们的 Swift 库是在线将 WORKBOOK 对象导出为 JPG 格式文件的专业解决方案。此 Cloud SDK 为 Swift 开发人员提供了强大的功能和完美的 JPG 输出。

Swift 中的代码示例,使用 REST API 将电子表格中的 WORKBOOK 导出为 JPG 格式

    // For complete examples and data files, please go to https://github.com/aspose-cells-cloud/aspose-cells-cloud-swift/
    import AsposeCellsCloud
    let expectation1 = self.expectation(description: "checkAuth")
    AsposeCellsCloudAPI.clientId = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
    AsposeCellsCloudAPI.clientSecret = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
    AuthAspose.checkAuth()
    {
        (authError) in
        guard authError == nil else {
            XCTFail("error checkAuth")
            return
        }
        expectation1.fulfill()
    }
    self.waitForExpectations(timeout: testTimeout, handler: nil)
    let expectation = self.expectation(description: "testpostExport_Workbook")
    let objectType:String = "workbook"
    let format:String = "jpg"
    var files = Dictionary<String, URL>()
    files[BOOK1] = getURL(BOOK1)
    files[MYDOC] = getURL(MYDOC)        
    LiteCellsAPI.postExport(files: files, objectType: objectType, format: format)
    {
        (response, error) in
        guard error == nil else {
            XCTFail("error testpostExport_Workbook")
            return
        }        
        if let response = response {
            XCTAssertTrue(response is FilesResult)
            expectation.fulfill()
        }
    }
    self.waitForExpectations(timeout: testTimeout, handler: nil)


如何使用 Swift API 将 WORKBOOK 导出为 JPG

  1. 创建一个帐户仪表板获取免费API配额和授权详细信息
  2. 使用客户端 ID、客户端密码、基本 URL 和 API 版本初始化 CellsApi
  3. 调用 postExport 方法获取结果流


系统要求