> ## Documentation Index
> Fetch the complete documentation index at: https://docs.doconda.com/llms.txt
> Use this file to discover all available pages before exploring further.

# DOCX to PDF API

> Convert DOCX to PDF by API with a Doconda review: you get the same Word file back, repaired, with its PDF. Also for PowerPoint, Excel and .doc.

To convert DOCX to PDF by API with Doconda, upload the Word file and ask for a review (`operation: "review"`). It returns
the same file, with the safe problems fixed, and its PDF. It is a review, not just a conversion: along with the PDF you
get a report of what was found and what was done.

## Steps

1. Put your API key (dashboard → **API keys**, it starts with `ak_eu_`) in `DOCONDA_API_KEY` and install the SDK
   (`pip install doconda` or `npm install @doconda/sdk`).
2. Upload the file, ask for the review and download the PDF:

<CodeGroup>
  ```python Python theme={"theme":{"light":"github-light","dark":"github-dark-dimmed"}}
  from doconda import Doconda

  doconda = Doconda()  # reads the key from DOCONDA_API_KEY
  file = doconda.files.upload("contract.docx")

  reviewed = doconda.documents.create(operation="review", file=file["id"])
  open("contract.pdf", "wb").write(doconda.documents.download(reviewed["id"], "pdf"))
  open("contract-reviewed.docx", "wb").write(doconda.documents.download(reviewed["id"], "docx"))
  ```

  ```ts TypeScript theme={"theme":{"light":"github-light","dark":"github-dark-dimmed"}}
  import { readFile, writeFile } from "node:fs/promises"
  import { Doconda } from "@doconda/sdk"

  const doconda = new Doconda()
  const file = await doconda.files.upload(await readFile("contract.docx"), "contract.docx")

  const reviewed = await doconda.documents.create({ operation: "review", file: file.id })
  await writeFile("contract.pdf", await doconda.documents.download(reviewed.id, "pdf"))
  await writeFile("contract-reviewed.docx", await doconda.documents.download(reviewed.id, "docx"))
  ```

  ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark-dimmed"}}
  curl https://api.eu.doconda.com/v1/files \
    -H "Authorization: Bearer $DOCONDA_API_KEY" \
    -F "file=@contract.docx"
  # → { "id": "file_01JAB3…", … }

  curl https://api.eu.doconda.com/v1/documents \
    -H "Authorization: Bearer $DOCONDA_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{ "operation": "review", "file": "file_01JAB3…" }'
  ```
</CodeGroup>

If Doconda made the Word file, there's no need to upload it: pass its id in `file` (`"doc_01JAB3…"`).

## What you get back

* **The same file, repaired**, in its format, and **its PDF**, in `outputs`. Links expire after 5 minutes; get fresh
  ones with `GET /documents/{id}/outputs`.
* `status`: `ready` (no problems, or all fixed), `ready_with_warnings` (minor warnings remain) or `needs_review`
  (something remains that can't be fixed without changing your content).
* A report (`documents.report(id)`) with each problem, where it is (`location.pages`) and each fix applied or discarded
  (`ledger`).

In Word it checks, among others, tables wider than the page, headings left alone at the bottom of a page, signatures
split across pages and gaps in numbering. **Your text doesn't change**: only safe fixes are applied, and each one only
if the file improves. The full list is in [Review](/en/guides/review).

## FAQ

<AccordionGroup>
  <Accordion title="Does it work for PowerPoint and Excel?">
    Yes. Review accepts `.docx`, `.pptx`, `.xlsx` and PDF, and returns the repaired file with its PDF.
  </Accordion>

  <Accordion title="And for old .doc, .ppt or .xls files?">
    Also. They are converted and the result comes out in the modern format (`.docx`, `.pptx`, `.xlsx`), with its PDF.
  </Accordion>

  <Accordion title="Does it use AI? How much does it cost?">
    It doesn't use AI. Reviewing a file costs €0.03; see [pricing](/en/guides/account#pricing).
  </Accordion>

  <Accordion title="Is it safe to upload my files?">
    Before opening it, the file is checked for security: files with macros are rejected and links to external resources
    are neutralized. Whatever is removed is listed in the report, under `sanitized.removed`.
  </Accordion>
</AccordionGroup>

## Keep reading

* [Review](/en/guides/review): everything checked in Word, PowerPoint, Excel and PDF.
* [Review and edit with the SDK](/en/sdk/review-edit).
* [Quickstart](/en/quickstart).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.