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

# Office to PDF

> Convert DOCX, XLSX, or PPTX files to PDF.

## Phase

**Phase 2** — Uses Gotenberg (LibreOffice) under the hood.

## Request

<ParamField body="source" type="object" required>
  The Office document to convert. One of:

  * `{ "url": "https://example.com/report.docx" }`
  * `{ "base64": "UEsDBBQ..." }` with `filename` required.
</ParamField>

<ParamField body="filename" type="string">
  Required when using `base64`. Must include the file extension to determine format: `.docx`, `.xlsx`, `.pptx`, `.odt`, `.ods`, `.odp`.
</ParamField>

<ParamField body="landscape" type="boolean" default="false">
  Force landscape orientation. Useful for spreadsheets.
</ParamField>

<ParamField body="format" type="string" default="a4">
  Page size for the output PDF.
</ParamField>

<ParamField body="compress" type="string" default="none">
  Compression for the output.
</ParamField>

<ParamField body="output" type="string" default="url">
  `url` or `base64`.
</ParamField>

## Supported formats

| Input        | Extension              | Notes                                                 |
| ------------ | ---------------------- | ----------------------------------------------------- |
| Word         | `.docx`, `.doc`        | Full layout support                                   |
| Excel        | `.xlsx`, `.xls`        | Each sheet becomes a page. Headers/footers preserved. |
| PowerPoint   | `.pptx`, `.ppt`        | One slide per page. Animations stripped.              |
| OpenDocument | `.odt`, `.ods`, `.odp` | Native support via LibreOffice                        |

<Warning>
  Conversion quality depends on font availability. PDFBase bundles 200+ common fonts (Google Fonts, Microsoft core fonts). Custom fonts in Office documents may fall back to similar alternatives.
</Warning>

## Response

```json theme={null}
{
  "id": "pdf_converted1",
  "object": "pdf",
  "status": "completed",
  "url": "https://files.pdfbase.dev/pdf_converted1.pdf?token=sig_abc",
  "pages": 12,
  "bytes": 540000,
  "source_format": "docx",
  "created_at": "2026-05-19T13:20:00Z",
  "expires_at": "2026-05-20T13:20:00Z",
  "render_time_ms": 3200
}
```

## Example

```bash theme={null}
curl -X POST https://api.pdfbase.dev/v1/convert/office \
  -H "Authorization: Bearer pk_live_xxx" \
  -H "Content-Type: application/json" \
  -d '{
    "source": { "url": "https://your-app.com/reports/monthly.xlsx" },
    "landscape": true,
    "format": "letter",
    "output": "url"
  }'
```
