# Office to PDF API

> Office to PDF converts Word, Excel, PowerPoint, OpenDocument, RTF, text and CSV files to PDF and returns a download link valid for 2 days, with the page count of the result. Upload the file or send its URL. Wide spreadsheets can be fitted one sheet per page. Paid plans can convert only selected pages and set landscape orientation.

**Endpoint:** `POST https://api.apiverve.com/v1/officetopdf`  
**Category:** Documents  
**Cost:** 30 credits per call  
**Canonical page:** https://apiverve.com/marketplace/officetopdf

## Overview

Documents are converted with LibreOffice, so fonts, tables, images and page layout are kept as closely as an office suite would print them. The file's extension is checked against its contents, and a file that turns out to be another office format is converted as what it really is. Each call accepts one document up to 10 MB. Password-protected documents are not supported.

## Authentication

Every call carries your key in an `x-api-key` header. The same key works across the whole
APIVerve catalog — there are no per-API subscriptions. Responses always use the same three
top-level keys: `status`, `error`, and `data`.

## Example request

```bash
curl -X POST "https://api.apiverve.com/v1/officetopdf" \
  -H "x-api-key: YOUR_API_KEY" \
  -F "document=@document.doc" \
  -F "pageRanges=1-2" \
  -F "landscape=false" \
  -F "singlePageSheets=false"
```

## Parameters

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `document` | string | No | The document to convert (up to 10 MB): doc, docx, xls, xlsx, ppt, pptx, odt, ods, odp, rtf, txt or csv, or a public URL to one |
| `pageRanges` | string | No | Pages to convert, such as 1-3,5. Converts the whole document when omitted. length 0-100. Premium field |
| `landscape` | boolean | No | Lay the pages out in landscape orientation. default false. Premium field |
| `singlePageSheets` | boolean | No | Fit each spreadsheet sheet onto a single page, so wide sheets keep all their columns together. Spreadsheet inputs only. default false |

## Response fields

- `pdfName` — string · File name of the PDF
- `inputName` — string · File name of the input document
- `inputFormat` — string · Format the document was converted as, detected from its contents (docx, xlsx, pptx...)
- `pageCount` — number · Pages in the PDF
- `landscape` — boolean · Whether landscape orientation was applied
- `pageRanges` — object · The pages converted, or null for the whole document
- `size` — number · Size of the PDF in bytes
- `expires` — number · When the download link expires (Unix time in milliseconds)
- `downloadURL` — string · Signed link to download the PDF, valid for 2 days

## Sample response

```json
{
  "status": "ok",
  "error": null,
  "data": {
    "pdfName": "8f3c2a51-6d0e-4b7a-9c1f-2e5d7a9b4c10.pdf",
    "inputName": "SampleDoc.docx",
    "inputFormat": "docx",
    "pageCount": 2,
    "landscape": false,
    "pageRanges": null,
    "size": 23654,
    "expires": 1792400000000,
    "downloadURL": "https://storage.googleapis.com/apiverve/APIData/officetopdf/8f3c2a51-6d0e-4b7a-9c1f-2e5d7a9b4c10.pdf?GoogleAccessId=635500398038-compute%40developer.gserviceaccount.com&Expires=1792400000&Signature=SAMPLE"
  }
}
```

## Use cases

- **Document Archiving** — Store contracts, letters and reports as PDFs so they open the same way everywhere, years later.
- **Invoice and Quote Delivery** — Turn invoices or quotes generated as Word or Excel files into PDFs before emailing them to customers.
- **Upload Normalization** — Accept any office file from users and keep a single PDF copy for previews and downstream processing.
- **Print Preparation** — Convert slide decks and spreadsheets to fixed-layout PDFs for printing or sharing.

## More

- Full reference: https://docs.apiverve.com/ref/officetopdf
- Get an API key: https://dashboard.apiverve.com
- Full catalog: https://apiverve.com/marketplace
