Converting Excel spreadsheets to JPG images offers a wide range of benefits for businesses and individuals alike. By exporting your spreadsheets as high-quality images, you can easily share them with others who may not have access to Excel or who may prefer to view your data as pictures. Additionally, converting Excel to JPG can be a useful way to create a snapshot of your data at a specific point in time, allowing you to easily reference your information later on. With Java REST API, converting Excel to JPG has never been easier, and in this guide, we’ll explore the benefits of this process in more details, as well as provide a step-by-step guide for how to do it.
- Excel to Image Conversion API
- Convert Excel to JPG in Java
- Spreadsheet Picture Generation using cURL Commands
Excel to Image Conversion API
Aspose.Cells Cloud SDK for Java is a powerful tool that allows you to easily convert Excel spreadsheets to JPG images with high fidelity. By using this SDK, you can streamline your document management workflow and improve collaboration by sharing your data in a visual format. This SDK also offers a wide range of benefits, including the ability to customize your output, automate your workflows, and ensures optimal results with minimal effort.
Let’s get started by adding its reference in Java maven build type project.
<repositories> <repository> <id>AsposeJavaAPI</id> <name>Aspose Java API</name> <url>https://repository.aspose.cloud/repo/</url> </repository> </repositories> <dependencies> <dependency> <groupId>com.aspose</groupId> <artifactId>aspose-cells-cloud</artifactId> <version>22.8</version> </dependency> </dependencies>
Furthermore, in order to access the Cloud services, you also need to create a free account over Cloud Dashboard. Then obtain your personalized Client ID and Client Secret details.
Convert Excel to JPG in Java
This section is going to explain the details on how to convert Excel to JPG using Java. In this process, we are going to convert all Worksheets to JPG images.
- Create an instance of CellsApi and provide client credentials as arguments.
- Declare the name of input Excel, resultant format as JPG, and output file name in string variables.
- Read the Excel file from local drive using File instance.
- Finally, call the method cellsWorkbookPutConvertWorkbook(…) for Excel to Image conversion operation.
The input Excel Workbook used in the above example can be downloaded from myDocument.xlsx.
Spreadsheet Picture Generation using cURL Commands
With REST API and cURL commands, we can easily convert Excel files to JPG images without the need for any specialized software or programming knowledge. This approach offers an array of benefits, including the ability to automate the workflows, integration with other systems, and we can customize the output to meet our specific needs.
Now, in order to accomplish this requirement, we need to generate a JWT access token by executing the following command:
curl -v "https://api.aspose.cloud/connect/token" \ -X POST \ -d "grant_type=client_credentials&client_id=bb959721-5780-4be6-be35-ff5c3a6aa4a2&client_secret=4d84d5f6584160cbd91dba1fe145db14" \ -H "Content-Type: application/x-www-form-urlencoded" \ -H "Accept: application/json"
Once we have a JWT token, we need to execute the following command to convert the selected worksheet named “Sheet2” to JPG format. After the conversion, the resultant JPG is returned in response stream and can easily be saved to local drive.
curl -v -X GET "https://api.aspose.cloud/v3.0/cells/myDocument.xlsx/worksheets/Sheet2?format=JPG&verticalResolution=800&horizontalResolution=1024" \ -H "accept: application/json" \ -H "authorization: Bearer <JWT Token>" \ -o Converted.jpg
The conversion of Excel spreadsheets to raster JPG images is an essential part of modern document management workflows, and there are many tools available to help in achieving this task. However, when choosing Aspose.Cells Cloud SDK for Java or REST API via cURL commands, the benefits of these approaches are clear. Furthermore, Aspose.Cells Cloud SDK for Java is highly scalable and can easily integrate with other systems, making it an ideal choice for businesses of all sizes. We hope this guide has provided you with a comprehensive understanding of the benefits of exporting spreadsheets as images, which enables you to improve collaboration, streamline your workflows, and ensure that your data is easily accessible to others.
With these techniques at your disposal, now you can easily convert XLS to JPG or XLSX to JPG in no time, increase your productivity and take your document management workflow to the next level. In case of any further query, please do not hesitate to contact us via the product support forum.
We highly recommend visiting the following links to learn more about: