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.

Convert an Office file to PDF

Add an Office file (for example, document.docx) in the same folder as your code, and send it to the /build endpoint:

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.

In this guide, conversion parameters are shown for the /build FilePart schema.

If you need advanced Office conversion options, use the Build document endpoint. The convenience endpoint /processor/convert_to_pdf (Convert to PDF in API reference) doesn’t expose all FilePart options.

markup_mode

markup_mode controls how markup (comments and tracked changes) is preserved during Word document conversion.

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

half_transparent_header_footer 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 valuestrue, false
  • Defaultfalse

render_only_print_area

render_only_print_area controls spreadsheet output scope.

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

Example with conversion parameters

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