How to Convert a Worksheet to HTML Using Aspose.Cells Cloud API
The ConvertWorksheetToHtml endpoint reads an Excel workbook from the local file system, extracts the specified worksheet, and returns the content as an HTML file. The conversion runs entirely on Aspose’s cloud servers, so no intermediate upload or storage is required. Ideal for generating web‑ready views of spreadsheet data, the API supports optional output paths, custom fonts, region settings, and password‑protected workbooks.
Convert worksheet to HTML API
Web API
PUT https://api.aspose.cloud/v4.0/cells/convert/worksheet/html
Security and Authentication
The Aspose.Cells Cloud APIs are secure and require JWT token-based authentication.
Request Parameters
| Parameter Name | Type | Location | Required/Optional | Description |
|---|---|---|---|---|
| Spreadsheet | File | Required | FormData | Binary Excel file to be processed. Must be a valid .xlsx, .xls, .xlsb, etc. Example: myWorkbook.xlsx. The Excel file is read directly from the request body; no prior upload to cloud storage is needed. |
| worksheet | String | Required | Query | Name of the worksheet to convert (case‑sensitive). Must exist in the supplied workbook. Example: Sheet1. |
| outPath | String | Optional | Query | Target folder path (in cloud storage) where the generated HTML file will be saved. If omitted, the file is returned directly in the response. Example: /output/html/. |
| outStorageName | String | Optional | Query | Name of the cloud storage service to use for outPath. Required only when outPath points to a non‑default storage. |
| fontsLocation | String | Optional | Query | Absolute path to a folder containing custom TrueType/OpenType fonts that should be used during conversion. Enables correct rendering of non‑standard characters. |
| region | String | Optional | Query | Locale identifier that influences number/date formatting (e.g., en-US, fr-FR). Defaults to the workbook’s internal region setting. |
| password | String | Optional | Query | Password required to open a protected workbook. Omit for unprotected files. |
Response
[
{
"Name": "ResponseFile",
"DataType": {
"Identifier": "File",
"Reference": "Stream"
}
}
]
HTTP Status Codes
| Code | Meaning | Description |
|---|---|---|
| 200 | OK | Filter applied successfully; response contains operation 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. |
Where should we use the Convert worksheet to HTML API?
- Embed live spreadsheet data in a web portal – Convert a financial‑report worksheet to HTML for direct viewing in browsers without requiring Excel plugins.
- Generate printable HTML invoices from an Excel template – Automate the creation of web‑ready invoice pages from a predefined worksheet.
- Create documentation snippets – Convert design‑specification sheets to HTML fragments that can be inserted into technical manuals or wikis.
- Develop low‑code BI dashboards – Pull worksheet data, convert it to HTML, and display it within custom dashboard widgets.
Why should you use the Convert worksheet to HTML API?
- Zero‑upload workflow – Convert local files directly in the cloud, eliminating the need to transfer large workbooks to storage first.
- High‑performance rendering – Server‑side conversion leverages Aspose’s optimized engine, delivering fast and accurate HTML output.
- Full control over output – Optional parameters (custom fonts, region, password) let you tailor the HTML to match locale and branding requirements.
- Seamless integration – Simple PUT request with multipart/form‑data fits naturally into CI/CD pipelines, micro‑services, or serverless functions.
How to use the Convert worksheet to HTML API with SDKs
Convert worksheet to HTML API Specification
Convert Worksheet to HTML API Specification provides a publicly accessible programming interface for executing REST interactions directly from a web browser.
You can use the cURL command‑line tool to access Aspose.Cells web services easily. The following example shows how to make calls to the Cloud API with cURL.
Use Aspose.Cells Cloud SDKs
Using the SDK is the fastest way to develop, as it abstracts away the low‑level details, allowing you to merge worksheets with concise code.
Please check out the Aspose.Cells Cloud SDK GitHub repository for a complete list of Aspose.Cells Cloud SDKs.
The following code examples demonstrate how to interact with Aspose.Cells web services using various SDKs: