Excel to PDF API
Convert Excel spreadsheets to PDF.
Feature
Request Mode
| Item | Value |
|---|---|
| Authentication | x-api-key: your_api_key_here |
| Request URL | POST http://localhost:8080/api/v1/process/xlsx/pdf |
| Content type | multipart/form-data |
| Success response | PDF file stream |
Request Parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
file | File | Source file. Recommended extension: .xls,.xlsx. | Yes |
options | String | JSON string containing the feature options below. | No |
password | String | Source file open password, used for password-protected PDFs. | No |
Options Parameters
Put the following fields in the options JSON string.
| Parameter | Type | Purpose |
|---|---|---|
sourceType | String or Integer | Source type flag for non-PDF to PDF conversion. The ComPDF Web sends 1. |
outputFileName | String | Optional output filename. When present, it is used as the preferred download filename. |
Request Example
bash
curl -X POST "http://localhost:8080/api/v1/process/xlsx/pdf" \
-H "x-api-key: your_api_key_here" \
-F "[email protected]" \
-F 'options={"sourceType":"1"}'Response
On success, the API returns the converted file stream with Content-Type and Content-Disposition headers. On failure, the ComPDF Self-hosted returns a normalized error JSON response.