🧩

DOCX to PDF

Convert a DOCX document to a PDF

POST 10 credits /v1/convert/docx-to-pdf
curl -X POST "https://convert.toolkitapi.io/v1/convert/docx-to-pdf" \
  -H "Content-Type: application/json" \
  -d '{"docx": "<base64-docx>"}'
import httpx

resp = httpx.post(
    "https://convert.toolkitapi.io/v1/convert/docx-to-pdf",
    json={"docx": "<base64-docx>"},
)
print(resp.json())
const resp = await fetch("https://convert.toolkitapi.io/v1/convert/docx-to-pdf", {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
  },
  body: JSON.stringify({"docx": "<base64-docx>"}),
});
const data = await resp.json();
console.log(data);
# See curl example
Response 200 OK
{
  "pdf": "<base64-pdf>",
  "page_count": 8,
  "file_size": 156720,
  "file_url": null,
  "file_name": "output.pdf",
  "file_type": "application/pdf"
}

Description

Convert a DOCX document to a PDF

How to Use

1

1. POST a JSON body containing the required `docx` field.

2

2. Supply the optional parameters to fine-tune output.

3

3. When object storage is enabled, read `file_url` for a direct download; otherwise decode the Base64 `pdf` payload.

4

4. Inspect `page_count` (or equivalent) to confirm the full document was processed.

About This Tool

Produce a high-fidelity PDF from a DOCX, rendered via LibreOffice in headless mode. Fonts, tables, lists and embedded images are preserved.

Use it to lock a Word document for distribution or archive.

Why Use This Tool

Frequently Asked Questions

Are fonts preserved?
Common fonts embedded in the DOCX render correctly. Unknown fonts fall back to the server's font set.
Does it support track changes?
Tracked changes are flattened into the PDF using the accepted revisions — there's no markup layer in PDF.
What about macros?
Macros are stripped during conversion — they don't exist in PDF.

Start using DOCX to PDF now

Get your free API key and make your first request in under a minute.