No local Excel install. No conversion server to maintain. Turn XLSX → PDF, Excel → CSV/JSON/images/HTML into plain REST calls — and have your first “cloud spreadsheet converter” running in about three minutes.
“Convert that spreadsheet to a different format” is one of the most common requirements in everyday development:
- Finance and legal teams want a read-only, tamper-resistant PDF report instead of an
.xlsxanyone can edit; - Data teams need to pull tabular data into downstream systems as CSV / JSON;
- Web and mobile apps want worksheets — and even charts — rendered straight to PNG / SVG;
- Portals want clean HTML / HTML-Table snippets to embed;
- Someone needs to normalize a pile of
.xls / .xlsx / .csv / .odsfiles into one format.
The old-school answers — a local Excel install with macros, or a heavyweight COM component on your own server — are painful to scale and hard to keep cross-platform. Aspose.Cells Cloud replaces all of that with a pure REST API: upload a file, get a new-format file back.
This post walks through the three conversion APIs exposed by the core ConversionController in the Aspose.Cells Cloud microservice (source: src/Aspose.Cells.Cloud.MicroService/Controllers/ConversionController.cs), with runnable examples in cURL, C# (.NET), Python, and Java.
1. What can the Convert feature do?
ConversionController is the controller dedicated to format conversion / export. It wraps the engine-level, high-fidelity conversion into three sets of HTTP APIs:
| # | Scenario | Typical endpoint | What it does |
|---|---|---|---|
| 1 | File already in cloud storage → download a new format | GET /v4.0/cells/{name}?format=pdf |
Converts a workbook directly in cloud storage and streams the result back — large files never have to travel to your machine |
| 2 | Local file → online conversion (headline feature) | PUT /v4.0/cells/convert/spreadsheet?format=pdf |
You upload the file in the request body (multipart); the server converts it and returns the result file directly |
| 3 | Cloud file → save as a new format, back to cloud storage | PUT /v4.0/cells/{name}/saveas?format=pdf |
The converted file is written straight back to cloud storage — ideal for automated pipelines |
Implementation note: the source routes use the prefix
v{version}/cellswith API version4.0, so live calls look likehttps://api.aspose.cloud/v4.0/cells/....
Conversion granularity goes far beyond “the whole file”
Besides converting an entire workbook, the controller can export a single element:
- A specific worksheet → PDF / image / CSV / JSON / HTML
- A specific cell range (e.g.
A1:C12) → PDF / image / CSV / JSON / HTML - A specific table → PDF / image / CSV / JSON / HTML
- A specific chart → PNG / JPEG / BMP / GIF / SVG / TIFF / EMF / PDF
So you never have to convert a whole 50 MB workbook just to grab one chart — convert only what you need and save bandwidth and compute.
2. Which formats are supported?
Based on the built-in ExportData registry in the controller, the conversion matrix looks roughly like this:
| Type | Formats |
|---|---|
| Import and export (bidirectional) | XLS, XLSX, XLSB, XLSM, CSV, TSV, ODS, TXT |
| Export-only | PDF, OTS, XPS, DIF, HTML / MHTML, JSON, PNG, JPEG, BMP, SVG, TIFF, EMF, NUMBERS, FODS, Markdown, DOCX, PPTX, SQL, etc. |
In short: spreadsheet-to-spreadsheet conversions of every kind, plus the whole family of spreadsheet → PDF / image / web-data outputs — all behind one API surface.
3. Two things you need before you start
- Register a free account on the Aspose Cloud Dashboard and create an Application to get a
Client IDandClient Secret(the SDKs exchange these for a JWT automatically — no need to build auth headers yourself). - Install the SDK for your language of choice:
<!-- .NET -->
<PackageReference Include="Aspose.Cells-Cloud" Version="25.x" />
# Python
pip install asposecellscloud
<!-- Java (Maven) — note: NOT on Maven Central, so the Aspose repo below is required -->
<repositories>
<repository>
<id>AsposeJavaAPI</id>
<name>Aspose Java API</name>
<url>https://repository.aspose.cloud/repo/</url>
</repository>
</repositories>
<dependency>
<groupId>com.aspose</groupId>
<artifactId>aspose-cells-cloud</artifactId>
<version>26.8</version>
</dependency>
No SDK required? Everything is plain REST, so cURL works just as well (see below).
4. Scenario 1: Convert a local Excel file online (the headline Convert API)
This is PUT /v4.0/cells/convert/spreadsheet — the flagship “Convert” API:
upload your local file in the request body, the server converts it and streams the new file back. Nothing is persisted in cloud storage and no upload copy lingers — perfect for “just convert this for me” moments.
① cURL
# 1) First, get a token
curl -X POST "https://api.aspose.cloud/connect/token" \
-d "grant_type=client_credentials" \
-d "client_id=YOUR_CLIENT_ID" \
-d "client_secret=YOUR_CLIENT_SECRET"
# 2) XLSX -> PDF
curl -X PUT "https://api.aspose.cloud/v4.0/cells/convert/spreadsheet?format=pdf" \
-H "Authorization: Bearer $TOKEN" \
-F "file=@Book1.xlsx" \
-o Book1.pdf
Swap format for csv, json, png, xlsx… and you get that format. One parameter, one output format.
② C# / .NET
using Aspose.Cells.Cloud.SDK.Api;
using Aspose.Cells.Cloud.SDK.Request;
var cellsApi = new CellsApi("YOUR_CLIENT_ID", "YOUR_CLIENT_SECRET");
var request = new ConvertSpreadsheetRequest(
spreadsheet: "C:/invoices/Book1.xlsx", // local file path
format: "pdf"); // target: pdf / csv / json / png ...
using Stream result = cellsApi.ConvertSpreadsheet(request); // converted file stream
using var outFile = File.Create("C:/invoices/Book1.pdf");
result.CopyTo(outFile);
// Even simpler: point the SDK at an output path and let it write the file
// cellsApi.ConvertSpreadsheet(request, "C:/invoices/Book1.pdf");
Need a batch job? Drop this into a loop over a directory and you have “convert the whole folder XLSX → PDF”.
③ Python
from asposecellscloud.apis.cells_api import CellsApi
from asposecellscloud.requests import ConvertSpreadsheetRequest
import os
instance = CellsApi(
os.getenv('CellsCloudClientId'),
os.getenv('CellsCloudClientSecret'))
# Local XLSX -> PDF, result written locally
instance.convert_spreadsheet(
ConvertSpreadsheetRequest("Book1.xlsx", "pdf"),
local_outpath="Book1.pdf")
# Other formats: just change the parameter — json / csv / xlsx / png ...
④ Java
import com.aspose.cloud.cells.api.CellsApi;
import com.aspose.cloud.cells.request.ConvertSpreadsheetRequest;
import java.io.File;
public class ConvertDemo {
public static void main(String[] args) throws Exception {
CellsApi api = new CellsApi("YOUR_CLIENT_ID", "YOUR_CLIENT_SECRET");
ConvertSpreadsheetRequest req = new ConvertSpreadsheetRequest();
req.setSpreadsheet("C:/invoices/Book1.xlsx"); // local file path
req.setFormat("pdf"); // target: pdf / csv / json / png ...
File out = api.convertSpreadsheet(req); // converted result as a File
out.renameTo(new File("C:/invoices/Book1.pdf"));
System.out.println("Converted: " + out.getAbsolutePath());
}
}
Four languages, one action: give a path + a format parameter → get the target file back. That is the whole selling point of the Convert API — zero Excel dependency on the caller side, no templates, no COM components.
5. Scenario 2: Convert a cloud-stored file directly
When a file already lives in Aspose Cloud Storage (or your object storage), you don’t need to download/upload large files — the conversion happens in the cloud, minimizing data transfer and improving performance on big workbooks:
# cloud Book1.xlsx -> PDF, downloaded locally
curl -G "https://api.aspose.cloud/v4.0/cells/Book1.xlsx" \
-H "Authorization: Bearer $TOKEN" \
--data-urlencode "format=pdf" \
--data-urlencode "folder=Reports" \
-o Book1.pdf
from asposecellscloud.apis.cells_api import CellsApi
from asposecellscloud.requests import ExportSpreadsheetAsFormatRequest
instance = CellsApi("YOUR_CLIENT_ID", "YOUR_CLIENT_SECRET")
# Convert a cloud-stored workbook straight to PDF
instance.export_spreadsheet_as_format(
ExportSpreadsheetAsFormatRequest("Book1.xlsx", format="pdf", folder="Reports"))
You can also drill into a single element — e.g. render “the 3rd chart on Sheet1” as PNG (cloud-storage flavour):
# chart -> PNG
curl -G "https://api.aspose.cloud/v4.0/cells/Book1.xlsx/worksheets/Sheet1/charts/2" \
-H "Authorization: Bearer $TOKEN" \
--data-urlencode "format=png" \
-o chart.png
Granular cloud endpoints at a glance:
| Target | Endpoint | Example format |
|---|---|---|
| Whole workbook | GET /v4.0/cells/{name} |
pdf / xlsx / csv / json |
| Single worksheet | GET /v4.0/cells/{name}/worksheets/{ws} |
pdf / png / svg |
| Single range | GET /v4.0/cells/{name}/worksheets/{ws}/ranges/{range} |
pdf / csv / json / html / png |
| Single table | GET /v4.0/cells/{name}/worksheets/{ws}/tables/{table} |
pdf / csv / json / html / png |
| Single chart | GET /v4.0/cells/{name}/worksheets/{ws}/charts/{index} |
pdf / png / jpeg / svg / tiff |
6. Scenario 3: SaveAs — write the result back to cloud storage
When you want the converted file persisted back to cloud storage (rather than downloaded), use PUT /v4.0/cells/{name}/saveas. It’s a natural fit for automation such as “export today’s report to PDF for archival, every day”:
curl -X PUT "https://api.aspose.cloud/v4.0/cells/Book1.xlsx/saveas?format=pdf" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{}'
from asposecellscloud.apis.cells_api import CellsApi
from asposecellscloud.requests import SaveSpreadsheetAsRequest
instance = CellsApi("YOUR_CLIENT_ID", "YOUR_CLIENT_SECRET")
instance.save_spreadsheet_as(
SaveSpreadsheetAsRequest("Book1.xlsx", format="pdf", folder="Reports"))
# Result is saved directly in cloud storage; returns CellsCloudResponse(Code=200, Status="OK")
You can pass fine-grained save options through the SaveOptionsData request body, and control output file name, output storage, custom fonts, region/locale, password, etc. via query parameters — more on those under Engineering details below.
7. More ready-made “online convert” endpoints
Besides the workbook-level conversions above, the controller exposes a full set of dedicated local-file → specific-target endpoints (same request-body upload as Scenario 1), which are more granular and cheaper on bandwidth:
| Goal | Endpoint (PUT, prefix /v4.0/cells/convert/) |
|---|---|
| Workbook → PDF / JSON / CSV | spreadsheet/pdf, spreadsheet/json, spreadsheet/csv |
| Worksheet → PDF / JSON / CSV / HTML / HTML-Table | worksheet/pdf, worksheet/json, worksheet/csv, worksheet/html, worksheet/html-table |
| Worksheet → image | worksheet/image?worksheet=Sheet1&format=png |
| Range → PDF / CSV / HTML / JSON / image | range/pdf, range/csv, range/html, range/json, range/image?worksheet=..&range=A1:C12&format=png |
| Table → PDF / CSV / HTML / JSON / image | table/pdf, table/csv, table/html, table/json, table/image |
| Chart → image / PDF | chart/image?worksheet=..&chartIndex=0&format=png, chart/pdf |
For example, “export just this range as CSV for the downstream system”:
curl -X PUT "https://api.aspose.cloud/v4.0/cells/convert/range/csv" \
-H "Authorization: Bearer $TOKEN" \
--data-urlencode "worksheet=Sheet1" \
--data-urlencode "range=A1:C100" \
-F "file=@data.xlsx" \
-o data.csv
These endpoints use the same upload-in-the-body pattern as convert/spreadsheet. In the .NET SDK the chart cases have typed wrappers that map to these v4.0 routes — ConvertChartToImage (convert/chart/image) and ConvertChartToPdf (convert/chart/pdf). The worksheet/*, range/* and table/* variants have no v4.0 wrapper yet, so call them over plain REST exactly as the cURL above does.
8. Engineering details & error handling
Conversion options worth knowing (query parameters)
password— open password-protected workbooks;fontsLocation/ custom-font support — keep glyphs correct when rendering PDF/images;- auto-fit rows/columns, and whether to print row/column headings (
printHeadings), region/page setup (region), etc.; - output side:
outPath/outStorageNamedecide where the result lands in cloud storage.
Error codes (the contract the controller documents)
| Status | Meaning | Typical cause |
|---|---|---|
| 400 | Bad Request | Invalid URL / parameters, or an unsupported format |
| 401 | Unauthorized | Authentication failed or no valid credentials were provided |
| 404 | Not Found | Source file is not accessible in cloud storage |
| 500 | Server Error | The service hit an anomaly while obtaining conversion data |
Authentication
All SDKs authenticate automatically with OAuth 2.0 client_credentials and a JWT; when using raw cURL, call /connect/token once first (see Scenario 1, ① above).
9. Why Aspose.Cells Cloud Convert?
- ✅ Zero local dependencies — no Office/Excel, no COM. Callable from any language and any platform (Linux, containers, serverless);
- ✅ High-fidelity rendering — powered by the Aspose.Cells engine, so formulas, charts, styles, and pagination render at professional quality into PDF/images;
- ✅ Cloud-native — files can stay in the cloud during conversion to avoid shipping large payloads; pure online conversion needs no cloud storage at all;
- ✅ Flexible granularity — workbook / worksheet / range / table / chart: convert exactly the piece you need;
- ✅ One shape across SDKs — the cURL, .NET, Python and Java examples map 1:1, so you can literally copy the pattern you like.
Get started now: register on the Aspose Cloud Dashboard, create an Application, drop your credentials into any snippet above, and run it — you’ll have your own “cloud Excel converter” in minutes.
Found this useful? Star, bookmark, or share it — and tell us about your own spreadsheet-conversion use cases in the comments.