How to Convert a Local Spreadsheet to PDF Using Aspose.Cells Cloud API
The ConvertSpreadsheetToPdf endpoint reads a spreadsheet file uploaded from a local drive, processes it on the Aspose.Cells Cloud server, and returns the resulting PDF document as a binary stream. This cloud‑native conversion eliminates the need to upload the source file to storage, reduces resource consumption, and simplifies workflows by delivering the PDF directly to the client. Supported formats depend on the underlying libraries; the API validates file existence, permissions, and conversion integrity, throwing appropriate HTTP errors for invalid input or processing failures.
Convert Spreadsheet To Pdf API
Web API
PUT https://api.aspose.cloud/v4.0/cells/convert/spreadsheet/pdf
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 | FormData | Required | The source spreadsheet file (XLS, XLSX, CSV, etc.) to be converted. Must be a valid, readable file; maximum size is 100 MB. Example: myWorkbook.xlsx. |
| outPath | String | Query | Optional | Destination folder path where the converted PDF will be stored on the server (if you want to save it). If omitted, the file is returned directly in the response. Example: /output/reports/. |
| outStorageName | String | Query | Optional | Name of the target storage service (e.g., MyCloudStorage). Required only when outPath is used and the storage is not the default. |
| fontsLocation | String | Query | Optional | Path to a custom fonts folder on the server to ensure proper text rendering in the PDF. Example: /fonts/custom/. |
| region | String | Query | Optional | Spreadsheet region/language setting (e.g., en-US, fr-FR). Influences number formatting, date parsing, and locale‑specific behavior. |
| password | String | Query | Optional | Password required to open a protected spreadsheet. Omit if the file is not encrypted. |
Response
Successful response (200 OK)
Content-Type: application/pdf
Content‑Disposition: attachment; filename=“converted.pdf”
Content‑Length: <size in bytes>
Body: binary stream of the generated PDF file
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 Spreadsheet To Pdf API?
- Automated reporting pipelines – Convert daily‑generated Excel reports to PDF for archiving or email distribution without manual steps.
- Document management systems – Store PDFs directly in a DMS after conversion, keeping the original spreadsheet only on the client side.
- Web applications with on‑the‑fly export – Allow end‑users to download a PDF version of a spreadsheet they edit in the browser, leveraging cloud conversion to preserve layout.
- Regulatory compliance – Generate immutable PDF snapshots of financial spreadsheets for audit trails, ensuring the source file never leaves the client environment.
- Cross‑format conversion workflows – Combine with other conversion endpoints such as the Convert Spreadsheet to CSV API to create multi‑format archives.
Why should you use the Convert Spreadsheet To Pdf API?
- Zero‑upload workflow – No need to upload the source file to cloud storage; conversion happens directly from the uploaded stream, saving bandwidth and storage costs.
- High‑fidelity rendering – Aspose.Cells preserves complex formulas, charts, and formatting when converting to PDF, matching desktop Excel output.
- Scalable cloud execution – Leverages Aspose’s cloud infrastructure for fast, reliable conversion regardless of client hardware.
- Simple REST interface – A single
PUTrequest with optional query parameters; returns a ready‑to‑download PDF stream, making integration straightforward in any language.
How to Use the Convert Spreadsheet To Pdf API with SDKs
Convert Spreadsheet To Pdf API Specification
The Convert Spreadsheet To Pdf 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 a spreadsheet into another spreadsheet with short code. Please check out the 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: