将 WORKBOOK 从 Excel 导出为 JPG

用于将 WORKBOOK 导出为 JPG 文件的 Android 库

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

使用 Cells Cloud SDK for Android 将 WORKBOOK 对象导出为 JPG 格式文件

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

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

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

// For complete examples and data files, please go to https://github.com/aspose-cells-cloud/aspose-cells-cloud-android/
    import java.io.*;
    import java.util.HashMap;
    import java.util.List;
    import java.util.Base64;
    import com.aspose.cloud.cells.api.*;
    import com.aspose.cloud.cells.model.*;
    public class Export {
        public static void main(String[] args) {
            String format = "jpg";
            String objectType = "workbook";
            HashMap<String,File> fileMap = new HashMap<String,File>();
            fileMap.put("Book1.xlsx" ,new File("C:\Book1.xlsx") );
            fileMap.put("myDocument.xlsx" ,new File("C:\myDocument.xlsx") );
            try {
                LightCellsApi cellsApi = new LightCellsApi(System.getenv("ProductClientId"), System.getenv("ProductClientSecret"),"v3.0","https://api.aspose.cloud");
                FilesResult response = cellsApi.postExport(fileMap,objectType, format,null);            
                List<FileInfo> files = response.getFiles();
                String filename = files.get(0).getFilename();
                String fileContent = files.get(0).getFileContent();
                byte[] data = Base64.getDecoder().decode(fileContent);
                OutputStream outputStream = new FileOutputStream(filename);
                outputStream.write(data,0,data.length);
                outputStream.close();
            }catch(Exception exception )
            {
                System.out.print(exception);
            }
        }
    }


如何使用Cells Cloud SDK for Android将Excel WORKBOOK中的对象导出为JPG

  1. 注册一个帐户仪表板获取免费API配额和授权详细信息
  2. 使用您的客户端 ID、客户端密钥、基本 URL 和 API 版本初始化 Cells API。
  3. 使用 `postExport` 方法检索结果流。


系统要求

  1. Android 7 或更高版本
  2. Java(TM) SE 运行时环境