apyhub
Back
FILE CONVERSION

Word to PDF API: Convert DOC, DOCX, ODT, and RTF

Hosted on ApyHub

What it does

The Word to PDF API converts Word documents into PDFs. Send a DOC, DOCX, ODT, or RTF file as an upload (up to 100 MB), as a URL, or as a base64 string, and get the PDF back either as the file itself or as a signed link you can store or share. Set landscape to true for wide documents such as tables and schedules.

Use it to turn contracts, proposals, and reports into PDFs before sending them to customers, convert user-uploaded documents into one consistent format before storage, or produce PDFs from templates your team edits in Word. To go the other way, use the PDF to Word API. For other document types, use the Spreadsheet to PDF, HTML to PDF, or Image to PDF APIs, and add a "DRAFT" or "CONFIDENTIAL" label with the PDF Watermark API.

Pick the endpoint that fits where your document is: upload endpoints when the file is in your app, URL endpoints when it's hosted elsewhere, and base64 endpoints when the document is already encoded in your data. You can start on ApyHub's free tier with no card required.

▣ ENDPOINT 01 / 06
POST
submit base64: download file
https://api.eu.apyhub.com/apyhub/convert-word-to-pdf/base64/link

QUICKSTART

GUIDE

Quickstart

Upload a Base64-encoded file and get back a PDF download link.

curl -X POST "https://api.eu.apyhub.com/apyhub/convert-word-to-pdf/base64/link" \
  -H "apy-token: $APY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "base64": "JVBERi0xLjQKJcfs...example-base64-content..."
  }'

Replace the example base64 value with the Base64-encoded content of your file.

What you'll get back

Returns a JSON object with a data string field containing the download URL for the generated PDF.

{
  "data": "https://example.com/output.pdf"
}
TRY ITLIVE · 100 ATOMS
Loading your default key…
The full key is used to call the gateway and stays in this tab — never sent to orbit or saved.
body*
Base64-encoded file bytes.

About this endpoint

What it does

Converts a base64-encoded Word document into a PDF and returns a signed link to the generated PDF. The request sends the file bytes as a base64 string, and the response contains the resulting PDF URL.

Request Body

ParameterTypeMandatoryDescription
base64StringYesBase64-encoded file bytes.

Response

Returns a JSON object with a data string field containing a URI to the generated PDF. Success responses are represented by a 200-level response with this object shape.

ParameterTypeMandatoryDescription
dataStringYesURI of the signed link to the generated PDF.

Body

Name
Type
Description
bodyREQUIRED
object
▣ ENDPOINT 02 / 06
POST
Upload file: download file
https://api.eu.apyhub.com/apyhub/convert-word-to-pdf/file/download

QUICKSTART

GUIDE

Quickstart

Upload a Word document to convert it to PDF.

curl -X POST "https://api.eu.apyhub.com/apyhub/convert-word-to-pdf/file/download?output=output.pdf" \
  -H "apy-token: $APY_TOKEN" \
  -F "file=@/path/to/document.docx"

What you'll get back

Returns a binary file - the converted PDF document.

TRY ITLIVE · 100 ATOMS
Loading your default key…
The full key is used to call the gateway and stays in this tab — never sent to orbit or saved.
Max 100MB total per request (all files combined). Larger? Use this API's URL-based endpoint instead, if it has one.
body*
.doc, .docx, .odt, or .rtf

About this endpoint

What it does

Converts an uploaded Word document to a PDF and returns the generated PDF as a binary response. The request sends the source file in the body and can optionally control the output filename and page orientation via query parameters.

Query Parameter(s)

AttributeTypeMandatoryDescription
outputStringNoOutput filename for the generated PDF.
landscapeBooleanNoPage orientation flag. Default: false.

Request Body

ParameterTypeMandatoryDescription
fileStringYesUploaded document file in binary form. Supported formats: .doc, .docx, .odt, or .rtf.

Response

Returns a binary file response containing the converted PDF.

Query parameters

Name
Type
Description
outputOPTIONAL
string
landscapeOPTIONAL
boolean
DEFAULT false

Body

Name
Type
Description
bodyREQUIRED
object

Max 100MB total per request (all files combined). Larger? Use this API's URL-based endpoint instead, if it has one.

▣ ENDPOINT 03 / 06
POST
upload file: generated url
https://api.eu.apyhub.com/apyhub/convert-word-to-pdf/file/link

QUICKSTART

GUIDE

Quickstart

Upload a Word file to convert it into a PDF.

curl -X POST "https://api.eu.apyhub.com/apyhub/convert-word-to-pdf/file/link?landscape=false" \
  -H "apy-token: $APY_TOKEN" \
  -F "file=@/path/to/document.docx"

What you'll get back

Returns a JSON object with a data string field containing the generated PDF URL.

{
  "data": "https://example.com/file.pdf"
}
TRY ITLIVE · 100 ATOMS
Loading your default key…
The full key is used to call the gateway and stays in this tab — never sent to orbit or saved.
Max 100MB total per request (all files combined). Larger? Use this API's URL-based endpoint instead, if it has one.
body*

About this endpoint

What it does

Converts an uploaded Word document to a PDF and returns a signed link to the generated PDF. The request sends the source file, and the response returns the resulting PDF URL as a string.

Query Parameter(s)

AttributeTypeMandatoryDescription
landscapeBooleanNoOptional page orientation flag. Default: false.

Request Body

ParameterTypeMandatoryDescription
fileStringYesWord document file to convert. Format: binary.

Response

Returns a JSON object with a data string field containing a URI to the generated PDF signed link. Success response: 200.

ParameterTypeMandatoryDescription
dataStringYesSigned link to the converted PDF. Format: URI.

Query parameters

Name
Type
Description
landscapeOPTIONAL
boolean
DEFAULT false

Body

Name
Type
Description
bodyREQUIRED
object

Max 100MB total per request (all files combined). Larger? Use this API's URL-based endpoint instead, if it has one.

▣ ENDPOINT 04 / 06
POST
submit url : download file
https://api.eu.apyhub.com/apyhub/convert-word-to-pdf/url/download

QUICKSTART

GUIDE

Quickstart

Convert a Word document from a public URL into a PDF. The url goes in the JSON body, and the optional landscape flag is sent as a query parameter if needed.

curl -X POST "https://api.eu.apyhub.com/apyhub/convert-word-to-pdf/url/download" \
  -H "apy-token: $APY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://assets.apyhub.com/samples/sample.docx"
  }' \
  -o converted.pdf

What you'll get back

Returns the converted PDF as a binary file response.

The example above saves the downloaded file locally as converted.pdf.

TRY ITLIVE · 100 ATOMS
Loading your default key…
The full key is used to call the gateway and stays in this tab — never sent to orbit or saved.
body*

About this endpoint

What it does

Converts a remote Word document at the provided URL into a PDF and returns the PDF as a binary download. You can also request landscape output through an optional query parameter.

Query Parameter(s)

AttributeTypeMandatoryDescription
landscapeBooleanNoSet to true to generate the PDF in landscape orientation. Default: false.

Request Body

ParameterTypeMandatoryDescription
urlStringYesThe remote Word document URL to convert. Must be a valid URI.

Response

Returns a binary PDF download.

Query parameters

Name
Type
Description
landscapeOPTIONAL
boolean
DEFAULT false

Body

Name
Type
Description
bodyREQUIRED
object
▣ ENDPOINT 05 / 06
POST
submit url: generated url
https://api.eu.apyhub.com/apyhub/convert-word-to-pdf/url/link

QUICKSTART

GUIDE

Quickstart

Convert a Word document from a URL into a PDF by sending the document link in the request body.

curl -X POST "https://api.eu.apyhub.com/apyhub/convert-word-to-pdf/url/link" \
  -H "apy-token: $APY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://assets.apyhub.com/samples/sample.docx"
  }'

What you'll get back

Returns a JSON object with a data string field containing the generated PDF file URL.

{
  "data": "https://assets.apyhub.com/files/output.pdf"
}
TRY ITLIVE · 100 ATOMS
Loading your default key…
The full key is used to call the gateway and stays in this tab — never sent to orbit or saved.
body*

About this endpoint

What it does

Converts a remote Word document available at a URL into a PDF and returns a signed PDF link. The request accepts the source document URL in the body, and the response returns the resulting PDF URL as a string.

Request Body

ParameterTypeMandatoryDescription
urlStringYesRemote Word document URL to convert. Must be a valid URI.

Response

Returns a JSON object with a data string field — a signed PDF URL returned after conversion.

ParameterTypeMandatoryDescription
dataStringYesSigned PDF URL. Must be a valid URI.

Body

Name
Type
Description
bodyREQUIRED
object
▣ ENDPOINT 06 / 06
POST
submit base64: download file
https://api.eu.apyhub.com/apyhub/convert-word-to-pdf/base64/download

QUICKSTART

GUIDE

Quickstart

Convert a Base64-encoded Word file into a downloadable PDF.

curl -X POST "https://api.eu.apyhub.com/apyhub/convert-word-to-pdf/base64/download" \
  -H "apy-token: $APY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "base64": "JVBERi0xLjQKJ...example-base64-content..."
  }' \
  -o converted.pdf

Replace the example base64 value with the Base64-encoded content of your Word document.

What you'll get back

Returns the generated PDF as a binary file response.

The example above saves the downloaded file locally as converted.pdf.

TRY ITLIVE · 100 ATOMS
Loading your default key…
The full key is used to call the gateway and stays in this tab — never sent to orbit or saved.
body*
Base64-encoded file bytes.

About this endpoint

What it does

Converts a base64-encoded Word document to a PDF and returns the PDF as a binary download. The request sends the document content in the body and can optionally request landscape output via a query parameter.

Query Parameter(s)

AttributeTypeMandatoryDescription
landscapeBooleanNoSet to true to generate the PDF in landscape orientation. Default: false.

Request Body

ParameterTypeMandatoryDescription
base64StringYesBase64-encoded file bytes.

Response

Returns a binary string representing the generated PDF file.

ParameterTypeMandatoryDescription
binaryStringYesThe PDF file content returned as binary data.

Query parameters

Name
Type
Description
landscapeOPTIONAL
boolean
DEFAULT false

Body

Name
Type
Description
bodyREQUIRED
object
▣ COMMON ERRORS

Errors any endpoint can return

400bad_request

Required parameter missing or malformed body.

401unauthorized

API key missing, revoked, or not authorized for this service.

429rate_limited

Your plan's per-second rate exceeded. Retry with exponential backoff.

503upstream_busy

Backend temporarily unavailable. Try again in a few seconds.