Export Excel Chart – Document
Exporting chart objects from an Excel workbook to various image and document formats is a common requirement for reporting and publishing. Aspose.Cells Cloud provides a simple REST endpoint that converts charts directly to popular formats such as PNG, JPEG, PDF, SVG, TIFF, EMF, WMF, and more.
You can export charts to the following formats: PNG, GIF, JPEG, BMP, SVG, TIFF, EMF, WMF, and PDF.
REST API
POST https://api.aspose.cloud/v3.0/cells/export
Security and Authentication
The Aspose.Cells Cloud APIs are secure and require JWT token-based authentication.
Request Parameters
| Parameter Name | Type | Path/Query String/HTTP Body | required | Description |
|---|---|---|---|---|
| file | file | formData | True | File to upload |
| objectType | string | query | True | The type of object to export. For chart export use chart. Other possible values are worksheet, picture, etc. |
| format | string | query | True | Desired output format. Supported values: png, jpeg, gif, bmp, svg, tiff, emf, wmf, pdf. |
Response
{
"Files": [
{
"Filename": "Book1_xlsx_Sheet4_Charts_0.tif",
"FileSize": 10040,
"FileContent": "-----Base64String--------"
},
{
"Filename": "Book1_xlsx_Sheet4_Charts_1.tif",
"FileSize": 12978,
"FileContent": "-----Base64String--------"
},
{
"Filename": "Book1_xlsx_Sheet4_Charts_2.tif",
"FileSize": 7002,
"FileContent": "-----Base64String--------"
},
{
"Filename": "Book1_xlsx_Sheet4_Charts_3.tif",
"FileSize": 11532,
"FileContent": "-----Base64String--------"
},
{
"Filename": "Book1_xlsx_Sheet6_Charts_0.tif",
"FileSize": 8270,
"FileContent": "-----Base64String--------"
},
{
"Filename": "myDocument_xlsx_Sheet3_Charts_0.tif",
"FileSize": 42570,
"FileContent": "-----Base64String--------"
},
{
"Filename": "myDocument_xlsx_Sheet3_Charts_1.tif",
"FileSize": 12102,
"FileContent": "-----Base64String--------"
},
{
"Filename": "myDocument_xlsx_Sheet3_Charts_2.tif",
"FileSize": 8290,
"FileContent": "-----Base64String--------"
}
]
}
Response Status Codes
| Code | Meaning | Description |
|---|---|---|
| 200 | OK | Compression succeeded; response contains compressed file details. |
| 400 | Bad Request | Missing or invalid parameters (e.g., unsupported file type). |
| 401 | Unauthorized | Invalid or missing JWT token. |
| 413 | Payload Too Large | Uploaded file exceeds size limit. |
| 500 | Internal Server Error | Unexpected server error. |
How to Use the PostExport API with SDKs
PostExport API Specification
The OpenAPI Specification defines a publicly accessible programming interface and lets you carry out REST interactions directly from a web browser.
All requests must include a valid OAuth 2.0 Bearer token in the Authorization header. The example below shows how to call the API with cURL and upload a workbook using multipart/form‑data.
curl -X POST "https://api.aspose.cloud/v3.0/cells/export?objectType=chart&format=tiff" \
-H "Authorization: Bearer {access_token}" \
-H "Accept: multipart/form-data" \
-H "Content-Type: multipart/form-data" \
-H "x-aspose-client: Containerize.Swagger" \
-F "File=@/path/to/your/workbook.xlsx"
Use Aspose.Cells Cloud SDKs
Using an SDK is the best way to speed up development. An SDK takes care of low‑level details and lets you focus on your project tasks. Please check out the GitHub repository for a complete list of Aspose.Cells Cloud SDKs.
The following code examples demonstrate how to make calls to Aspose.Cells web services using various SDKs: