# Office to PDF & PDF/A: Word, Excel, PowerPoint, HTML, Images (`ai_admin/office-to-pdf`) Actor

Convert Word, Excel, PowerPoint (incl. legacy DOC, XLS, PPT), OpenDocument, RTF, CSV, HTML and images to PDF or archival PDF/A-2b for courts, tax portals and archives. $10 per 1,000 documents, batch and merge, files stay inside the Actor.

- **URL**: https://apify.com/ai_admin/office-to-pdf.md
- **Developed by:** [Andriy Kuzmenko](https://apify.com/ai_admin) (community)
- **Categories:** Developer tools, Automation, AI
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $10.00 / 1,000 converted documents

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## Office to PDF & PDF/A: Word, Excel, PowerPoint, HTML, Images

Convert office documents to PDF — or to archival **PDF/A-2b** — in bulk, with a download link for every file.
Word, Excel, PowerPoint, OpenDocument, RTF, TXT, CSV, HTML and images, modern and legacy formats alike.

- **All common formats.** DOCX, DOC, ODT, RTF, TXT, HTML, XLSX, XLS, ODS, CSV, PPTX, PPT, ODP, PNG, JPG, TIFF, SVG.
- **PDF/A for archives and e-filing.** One switch produces PDF/A-2b, the format courts, tax portals and archives ask for.
- **Faithful layout.** LibreOffice with metric-compatible fonts (Calibri, Cambria, Arial, Times New Roman, Courier
  equivalents) keeps line and page breaks; Cyrillic, Greek and most Latin scripts are covered.
- **Batch and merge.** Convert hundreds of files in one run and optionally get them merged into a single PDF.

### Why this Actor

| | This Actor | Typical alternatives |
|---|---|---|
| **Archival PDF/A-2b** | One switch — for courts, tax portals, e-invoicing and long-term archives | Usually plain PDF only |
| **Legacy files** | DOC, XLS, PPT, RTF and OpenDocument convert as well as DOCX/XLSX/PPTX | Modern formats only, or none at all |
| **Price** | **$10 per 1,000 documents**, any number of pages | Online converters: subscriptions or per-page fees; most Store PDF tools only render HTML/URLs ($5–25 per 1,000) |
| **Batch + merge** | Hundreds of files per run, optional single merged PDF, links for every file | Often one file at a time |
| **Privacy** | LibreOffice runs inside the Actor; files are not sent to a third-party conversion API | Many converters upload your files to an external service |

### Input

```json
{
  "sources": [
    { "url": "https://example.com/contract.docx" },
    { "url": "https://example.com/price-list.xlsx" }
  ],
  "pdfA": false,
  "mergeIntoOne": true
}
```

| Field | Meaning |
|---|---|
| `sources` | File URLs. Files in your own Apify key-value store work too: set the store's access to "Anyone with ID can read" and use `https://api.apify.com/v2/key-value-stores/<store ID>/records/<key>` (the Actor runs with limited permissions and does not use your token). |
| `pdfA` | Produce PDF/A-2b instead of plain PDF |
| `mergeIntoOne` | Also return `merged.pdf` with all converted documents in input order (no extra charge) |

### Output

One dataset item per document:

```json
{
  "url": "https://example.com/contract.docx",
  "fileName": "contract.docx",
  "format": "docx",
  "pdfUrl": "https://api.apify.com/v2/key-value-stores/.../records/0001-contract.pdf?signature=...",
  "pdfKey": "0001-contract.pdf",
  "pages": 4,
  "bytes": 58211,
  "pdfA": false
}
```

The PDFs are stored in the run's key-value store; `pdfUrl` is a ready download link. A document that cannot be
downloaded or opened (damaged, password-protected, wrong extension) gets an `error` field instead and is **not charged**.

### Pricing

Pay per event:

| Event | Price | What counts |
|---|---|---|
| `document` | **$10 per 1,000** | one successfully converted document (any number of pages) |

Plus Apify's standard start fee of $0.05 per 1,000 runs. Merging is free. The run converts only as many documents as fit
under your maximum charge per run.

### Use with AI agents and code

- **MCP (Claude, Cursor, VS Code, any MCP client):** add `https://mcp.apify.com?tools=ai_admin/office-to-pdf` as an MCP server —
  the agent gets one tool with this Actor's input schema and pays per use through your Apify account.
- **One HTTP call that returns the results:**

```bash
curl -X POST "https://api.apify.com/v2/acts/ai_admin~office-to-pdf/run-sync-get-dataset-items?token=$APIFY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"sources": [{"url": "https://api.apify.com/v2/key-value-stores/FloomuI2DrQCJazY8/records/doc-en.docx"}, {"url": "https://api.apify.com/v2/key-value-stores/FloomuI2DrQCJazY8/records/sheet-en.xlsx"}], "pdfA": true, "mergeIntoOne": false}'
```

- **Agentic payments:** the Actor is enabled for Apify's agentic payments (x402), so autonomous agents can pay per run.

Open source: [github.com/AndriyVK/-apify-document-tools](https://github.com/AndriyVK/-apify-document-tools)

### Limits

- Password-protected files are not supported. Maximum download size is 200 MB per file.
- Fonts that are not installed are replaced by metric-compatible ones; exotic fonts may change the look slightly.
- Multi-page TIFF images may be converted to their first page only.
- Macros are not executed (LibreOffice default macro security).

# Actor input Schema

## `sources` (type: `array`):

Public URLs of the files: DOCX, DOC, ODT, RTF, TXT, HTML, XLSX, XLS, ODS, CSV, PPTX, PPT, ODP, PNG, JPG, TIFF, SVG. Files in your own Apify key-value store work too: set the store's access to "Anyone with ID can read" and use https://api.apify.com/v2/key-value-stores/<store ID>/records/<key>.

## `pdfA` (type: `boolean`):

Produce PDF/A-2b files for long-term archiving and e-filing portals that require PDF/A.

## `mergeIntoOne` (type: `boolean`):

Besides the individual PDFs, return merged.pdf with all converted documents in input order (free).

## Actor input object example

```json
{
  "sources": [
    {
      "url": "https://api.apify.com/v2/key-value-stores/FloomuI2DrQCJazY8/records/doc-en.docx"
    }
  ],
  "pdfA": false,
  "mergeIntoOne": false
}
```

# Actor output Schema

## `documents` (type: `string`):

Dataset items: url, format, pdfUrl, pages, bytes, pdfA or error for every input URL.

## `files` (type: `string`):

All PDFs (and merged.pdf) in the run's key-value store.

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "sources": [
        {
            "url": "https://api.apify.com/v2/key-value-stores/FloomuI2DrQCJazY8/records/doc-en.docx"
        }
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("ai_admin/office-to-pdf").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = { "sources": [{ "url": "https://api.apify.com/v2/key-value-stores/FloomuI2DrQCJazY8/records/doc-en.docx" }] }

# Run the Actor and wait for it to finish
run = client.actor("ai_admin/office-to-pdf").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "sources": [
    {
      "url": "https://api.apify.com/v2/key-value-stores/FloomuI2DrQCJazY8/records/doc-en.docx"
    }
  ]
}' |
apify call ai_admin/office-to-pdf --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,ai_admin/office-to-pdf"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/gwRuM7Y7jiidFkCRC/builds/xJ0bpM6mEcjY1G7Y8/openapi.json
