This HTML page is not optimized for LLM or AI agent consumption. Fetch the Markdown version instead: /guides/dws-processor/tools-and-api/office-to-pdf-api.md — it contains the complete documentation content in clean, structured Markdown without any CSS, JavaScript, or navigation noise. Office-to-PDF API

Use the Office-to-PDF API to convert Office documents (DOC, DOCX, XLS, XLSX, PPT, and PPTX) to PDF. For an overview of signup, pricing, and conversion examples by file type, refer to the Office-to-PDF API task page.

Before you start

Prepare your account, API key, and source file:

  1. Create a Processor API account(opens in a new tab) or sign in to your existing account.
  2. Open the API keys page(opens in a new tab).
  3. Copy a live key with Processor API access.
  4. Replace the API key placeholder in the example with your key.
  5. Save a representative Office file in the same folder as your code.

Use fictional data to test the setup.

Keep your API key on the backend. Don’t include it in browser code or commit it to source control. For account setup and free-plan output restrictions, refer to the getting started guide.

Convert an Office file to PDF

Send the Office file to the /build endpoint. These examples use document.docx from the same folder as your code:

curl -X POST https://api.nutrient.io/build \
-H "Authorization: Bearer your_api_key_here" \
-F 'document=@document.docx' \
-F 'instructions={
"parts": [
{
"file": "document"
}
]
}' \
--fail \
-o result.pdf

Convert an Office file from a URL

For remotely hosted source files, pass the URL in parts[].file.url:

{
"parts": [
{
"file": {
"url": "https://www.nutrient.io/downloads/examples/paper.docx"
}
}
]
}

Conversion parameters

Customize conversion behavior by adding parameters to each parts item.

This guide uses the /build FilePart schema for conversion parameters.

For advanced Office conversion options, use the build document endpoint. The /processor/convert_to_pdf convenience endpoint doesn’t expose all FilePart options. The API reference lists this endpoint as convert to PDF.

markup_mode

markup_mode controls how the API renders comments and tracked changes when converting Word documents.

  • Applicable to — Word documents (.docx)
  • Supported values —
    • Render the document with all changes accepted — noMarkup (default).
    • Render the document with all changes rejected — original.
    • Render accepted changes and comments as annotations — simpleMarkup.
    • Render all markup, including redlines and comments — allMarkup.
  • Default — noMarkup

half_transparent_header_footer controls whether the API renders headers and footers as half-transparent in the converted PDF.

  • Available via — /build only
  • Not exposed by — /processor/convert_to_pdf
  • Applicable to — Word documents (.doc, .docx, .odt, .rtf)
  • Supported values — true, false
  • Default — false

render_only_print_area

render_only_print_area controls whether the API renders the full spreadsheet content or only the defined print area.

  • Available via — /build only
  • Not exposed by — /processor/convert_to_pdf
  • Applicable to — Spreadsheet documents (.xls, .xlsx)
  • Supported values —
    • Render the full sheet content — false (default).
    • Render only the defined print area — true.

If the spreadsheet has no defined print area, the API renders the full sheet even when render_only_print_area is true.

Example with conversion parameters

Add conversion parameters alongside file in a parts item:

{
"parts": [
{
"file": "document",
"markup_mode": "allMarkup",
"half_transparent_header_footer": true,
"render_only_print_area": true
}
]
}

Check the converted PDF

Open the converted PDF beside the source file before using it in a larger workflow. Check the output for your document type:

  • Word — Compare page breaks, headers, footers, tables, and text layout. Check that tracked changes and comments match the selected markup_mode.
  • Excel — Check sheet content, page breaks, and print areas. Confirm that render_only_print_area produces the full sheet or defined print area as required.
  • PowerPoint — Compare slide layout, text wrapping, and image placement.

Repeat these checks with representative files before automating a batch. A successful API response alone doesn’t establish that the PDF meets your layout requirements.

Use these references to compare endpoint options: