Word to PDF

Convert Microsoft Word documents to PDF format.

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

Authentication

AuthorizationBearer

Retrieve your API Key from Dashboard.

Request Body

Provide the Word document using one of the following methods.

fileFile

Word document uploaded via multipart/form-data. Supported formats: .docx, .doc, .odt, .rtf

urlstringOptional

Public URL pointing to a Word document. 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 Word document formats: .docx, .doc, .odt, .rtf

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.

originalSizenumber

Input file size in bytes.

outputSizenumber

Output PDF file size in bytes.

processingTimeMsnumber

Time taken to process the conversion in milliseconds.

Binary Response

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

  • Content-Type: application/pdf
  • Content-Disposition: attachment; filename="document.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/word-to-pdf
curl -X POST "https://api.morphopdf.com/v1/convert/word-to-pdf?format=binary" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -F "file=@document.docx" \
  --output document.pdf
200OK
{
  "success": true,
  "message": "File processed successfully",
  "fileName": "document.pdf",
  "downloadUrl": "https://files.morphopdf.com/sessions/abc123/output/document.pdf?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Expires=3600&...",
  "originalSize": 45056,
  "outputSize": 128000,
  "processingTimeMs": 1500
}