Excel to PDF

Convert Microsoft Excel spreadsheets to PDF format.

POSThttps://api.morphopdf.com/v1/convert/excel-to-pdf

Authentication

AuthorizationBearer

Retrieve your API Key from Dashboard.

Request Body

Provide the Excel file using one of the following methods.

fileFile

Excel file uploaded via multipart/form-data. Supported formats: .xlsx, .xls, .csv, .ods

urlstringOptional

Public URL pointing to an Excel file. Alternative to file upload.

Query Parameters

formatstringOptionalDefault: json

Response 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):

successboolean

Indicates whether the operation completed successfully.

messagestring

Human-readable status message.

fileNamestring

Name of the generated PDF file.

downloadUrlstring

Presigned URL to download the converted PDF. Valid for 1 hour.

processingTimeMsnumber

Time taken to process the conversion in milliseconds.

methodstring

Conversion method used (e.g., 'libreoffice').

sheetCountnumber

Number of sheets in the Excel file.

environmentstring

Processing environment used (e.g., 'docker').

originalSizenumber

Input file size in bytes.

outputSizenumber

Output PDF file size in bytes.

Binary Response

Add ?format=binary to receive the PDF directly with these headers:

  • Content-Type: application/pdf
  • Content-Disposition: attachment; filename="spreadsheet.pdf"

Error Responses

StatusCodeDescription
400INVALID_INPUTNo file provided or invalid file format
401AUTHENTICATION_REQUIREDMissing or invalid API key
413FILE_TOO_LARGEFile exceeds maximum size limit
500PROCESSING_FAILEDInternal processing error
POST/v1/convert/excel-to-pdf
curl -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
200OK
{
  "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
}