Word to PDF
Convert Microsoft Word documents to PDF format.
https://api.morphopdf.com/v1/convert/word-to-pdfAuthentication
Retrieve your API Key from Dashboard.
Request Body
Provide the Word document using one of the following methods.
fileFileWord document uploaded via multipart/form-data. Supported formats: .docx, .doc, .odt, .rtf
urlstringOptionalPublic URL pointing to a Word document. 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 Word document formats: .docx, .doc, .odt, .rtf
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.
originalSizenumberInput file size in bytes.
outputSizenumberOutput PDF file size in bytes.
processingTimeMsnumberTime taken to process the conversion in milliseconds.
Binary Response
Add ?format=binary to receive the PDF directly with these headers:
Content-Type: application/pdfContent-Disposition: attachment; filename="document.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/word-to-pdfcurl -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{
"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
}