Excel to PDF
Convert Microsoft Excel spreadsheets to PDF format.
https://api.morphopdf.com/v1/convert/excel-to-pdfAuthentication
Retrieve your API Key from Dashboard.
Request Body
Provide the Excel file using one of the following methods.
fileFileExcel file uploaded via multipart/form-data. Supported formats: .xlsx, .xls, .csv, .ods
urlstringOptionalPublic URL pointing to an Excel file. Alternative to file upload.
Query Parameters
formatstringOptionalDefault: jsonResponse format. Use 'binary' to receive the PDF directly, or 'json' (default) to receive metadata with a download URL.
Supported Formats
This endpoint accepts the following spreadsheet formats: .xlsx, .xls, .csv, .ods
Response
When using format=json (default):
successbooleanIndicates whether the operation completed successfully.
messagestringHuman-readable status message.
fileNamestringName of the generated PDF file.
downloadUrlstringPresigned URL to download the converted PDF. Valid for 1 hour.
processingTimeMsnumberTime taken to process the conversion in milliseconds.
methodstringConversion method used (e.g., 'libreoffice').
sheetCountnumberNumber of sheets in the Excel file.
environmentstringProcessing environment used (e.g., 'docker').
originalSizenumberInput file size in bytes.
outputSizenumberOutput PDF file size in bytes.
Binary Response
Add ?format=binary to receive the PDF directly with these headers:
Content-Type: application/pdfContent-Disposition: attachment; filename="spreadsheet.pdf"
Error Responses
| Status | Code | Description |
|---|---|---|
| 400 | INVALID_INPUT | No file provided or invalid file format |
| 401 | AUTHENTICATION_REQUIRED | Missing or invalid API key |
| 413 | FILE_TOO_LARGE | File exceeds maximum size limit |
| 500 | PROCESSING_FAILED | Internal processing error |
/v1/convert/excel-to-pdfcurl -X POST "https://api.morphopdf.com/v1/convert/excel-to-pdf?format=binary" \
-H "Authorization: Bearer YOUR_API_KEY" \
-F "file=@spreadsheet.xlsx" \
--output spreadsheet.pdf{
"success": true,
"message": "File processed successfully",
"fileName": "spreadsheet.pdf",
"downloadUrl": "https://files.morphopdf.com/sessions/abc123/output/spreadsheet.pdf?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Expires=3600&...",
"processingTimeMs": 2100,
"method": "libreoffice",
"sheetCount": 3,
"environment": "docker",
"originalSize": 35840,
"outputSize": 98304
}