# Word to PDF Converter - Excel and PowerPoint (`marcel-rbro/word-to-pdf`) Actor

Convert Word to PDF online in seconds. Upload a document or paste a URL and get the PDF back, including archival PDF/A. Also converts Excel, PowerPoint, OpenDocument and RTF. Up to 100 files per run. No Microsoft Office licence, no desktop install.

- **URL**: https://apify.com/marcel-rbro/word-to-pdf.md
- **Developed by:** [Marcel Rebro](https://apify.com/marcel-rbro) (community)
- **Categories:** Developer tools, Automation
- **Stats:** 2 total users, 1 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per usage

This Actor is paid per platform usage. The Actor is free to use, and you only pay for the Apify platform usage, which gets cheaper the higher subscription plan you have.

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

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

Convert **Word to PDF** online, along with Excel, PowerPoint, OpenDocument, RTF and plain text files. Upload one document or a hundred, get a PDF back for each - including archival PDF/A output. No Microsoft Office licence, no desktop install, no watermark stamped across the result.

The Actor is named for Word because that is what people search for, but it converts the whole Office family. Writer handles `.docx`, `.doc`, `.odt`, `.rtf` and `.txt`; Calc handles `.xlsx`, `.xls`, `.ods` and `.csv`; Impress handles `.pptx`, `.ppt` and `.odp`. It is the same code path each time - the file is read, the module that owns it is worked out from the bytes rather than the file extension, and LibreOffice exports the PDF.

- 📄 **Converts Word, Excel and PowerPoint** - twelve input formats, one PDF out
- 📁 **Converts a whole folder in one run** - up to 100 documents, each becoming its own PDF, all of them also packed into a single ZIP. One bad file does not stop the rest
- 🏛️ **Archival PDF/A-1b, PDF/A-2b and PDF/A-3b** - embeds every font and forbids anything whose appearance depends on the machine opening it, which is what archives and tax authorities ask for
- 🔖 **Keeps headings as PDF bookmarks** - a long report stays navigable in the reader's sidebar
- 🔤 **Metric-compatible fonts are installed** - Carlito for Calibri, Liberation for Arial and Times New Roman, so a document keeps its line breaks and its page count
- 🖼️ **Image quality and downsampling controls** - the practical way to get a photo-heavy deck under an email size limit
- 🔌 **Runs from the API, a schedule or an integration** - it is an Apify Actor, so Zapier, Make, n8n and MCP clients can call it

### How to convert Word to PDF

1. Click **Try for free** and sign in to Apify.
2. Upload your `.docx` file in the **Word file** field, or paste a direct URL to it.
3. Leave **PDF version** on **Standard PDF** unless you need an archival file.
4. Click **Start**.
5. Download the PDF from the **Storage** tab, or from the download URL in the run's dataset record.

#### How to convert Excel to PDF

Identical steps with an `.xlsx`, `.xls`, `.ods` or `.csv` file. The result is what Calc would print, which is worth knowing: a spreadsheet with no print range set and a hundred columns of data becomes a great many pages. Set the print area, the page orientation and the scaling in Excel before converting, and the PDF will match.

#### How to convert PPT to PDF

Upload a `.ppt`, `.pptx` or `.odp` file. One slide becomes one page at the slide's own aspect ratio, so a 16:9 deck produces a 16:9 PDF rather than a letterboxed A4 one. Speaker notes are not exported.

#### How to convert DOCX to PDF

`.docx` is the ordinary modern Word format and the one this Actor is built around. `.doc` - the pre-2007 binary format - goes through the same path, and so do the macro-enabled `.docm` and the OpenDocument `.odt`. Nothing extra to configure: the Actor reads the document's content types part to see what it is, so a file with the wrong extension still reaches the right module.

#### How to convert PPTX to PDF

Same as `.ppt` above. `.pptx` generally converts with better fidelity than the old binary `.ppt`, because it carries explicit layout information rather than relying on a rendering engine's conventions.

#### How to convert RTF, TXT and CSV to PDF

These three have no container to inspect, so they are decided by their extension - which matters, because the same comma-separated bytes are a text document if you call them `.txt` and a spreadsheet if you call them `.csv`. CSV files are read as comma-separated UTF-8 with double-quote text delimiters, deliberately fixed rather than guessed.

#### How to convert a folder of documents to PDF in one run

Select every file in the **Documents** field rather than one, or pass an array of URLs to `files` from the API. Up to 100 documents per run. Each one becomes its own PDF in the run's storage, under its own filename, and all of them are also packed into a single `documents.zip` so there is one thing to download rather than fifty.

Mixing formats in one batch is fine and is the ordinary case: a folder of Word documents, spreadsheets and decks converts in a single run, because the module that opens each file is worked out per file.

**One bad file does not cost you the batch.** A password-protected document, a URL that returns a login page, a `.docx` that is actually a JPEG - each is recorded against its own row in the dataset with the reason, and the run carries on. The run only fails if nothing at all converted. The log ends with a count: `converted 47, failed 3`.

This is also the cheap way to use the Actor. See the cost section below: the container startup you pay for once is the same whether you convert one document or a hundred.

### Input

Upload the files in the **Documents** field, or pass direct URLs to them.

| Field | Description |
|---|---|
| `files` | The documents to convert. File uploads or URLs, up to 100 per run. |
| `file` | A single document. Hidden in the Console and kept for API callers and saved input configurations written before `files` existed. Ignored when `files` is filled in. |
| `pdfVersion` | `default`, `1.5`, `1.6`, `1.7`, `pdfa-1b`, `pdfa-2b` or `pdfa-3b`. |
| `outputFilename` | Defaults to the input filename with a `.pdf` extension. In a batch it names the ZIP instead, and each PDF keeps its own filename. |
| `exportBookmarks` | `true` by default. Turns headings and bookmarks into PDF outline entries. |
| `imageQuality` | 1 to 100, default 90. JPEG quality for images inside the document. |
| `maxImageResolution` | `0` (do not reduce), `75`, `150`, `300`, `600` or `1200` DPI. |
| `fileBase64`, `filename` | A single file as base64, for API callers who prefer JSON to a URL. |
| `verboseLog` | Include the full LibreOffice output in the Actor log. |

#### Which PDF version should I choose?

**Standard PDF** for anything you are going to email, print or upload. It is the smallest of the options and every reader written this century opens it. LibreOffice currently writes PDF 1.6 for this setting; the exact version is reported in the run's dataset record.

**PDF/A** when the file has to survive. The profile embeds every font, forbids transparency features whose rendering has drifted between readers, and records its own conformance level inside the file. Archives, courts, patent offices and tax authorities generally ask for **PDF/A-1b** or **PDF/A-2b**; **PDF/A-3b** is the same thing but permits arbitrary file attachments, which is how e-invoicing formats such as ZUGFeRD and Factur-X ship their XML inside the PDF. Archival files are larger, sometimes several times larger, because the fonts travel with them.

### Output

Every converted PDF is written to the run's key-value store under its own filename, so it is downloadable from the **Storage** tab. Names are sanitised to the character set store keys allow, and collisions are de-duplicated rather than silently overwritten - which matters more here than in most converters, since every output is a `.pdf`, so a `notes.docx` and a `notes.xlsx` in the same batch become `notes.pdf` and `notes-2.pdf`.

`OUTPUT` is the record the `run-sync` endpoint returns in its HTTP response body, and it holds whatever a caller most likely wants:

| Run | `OUTPUT` |
|---|---|
| One document | The PDF itself, so `run-sync` returns a PDF. |
| Several documents | A ZIP of every PDF, also stored as `documents.zip`. |
| A batch whose PDFs total more than 192 MB | A JSON manifest of the keys, sizes and download URLs. The archive has to be held in memory to be uploaded, so past that size it is skipped rather than risking the run; the individual PDFs are all still there. |

**One dataset record per input file**, carrying `ok`, the source format, the module that converted it, the PDF version, file sizes and download URLs - and, for anything that failed, `error` with the reason in plain language. Records are pushed as each file finishes, so a run that dies at file 80 still has 79 results.

### How much does it cost to convert Word to PDF?

| Job | Run time | Cost |
|---|---|---|
| One Word letter | 11.8 s | **$0.0015** |
| 10 letters in one run | 16.7 s | **$0.0026**, or $0.0003 each |

Measured 2026-08-26 on the Free plan at the default 2048 MB, read back from the run API.

**A document costs a fraction of a cent**, and Apify's [free plan](https://apify.com/pricing)
includes $5 of usage a month.

**Batch, and the cost of a folder is close to the cost of one document.** That matters more here than
anywhere else in the family, because LibreOffice is large: the image is roughly 1.4 GB even with only
Writer, Calc and Impress, and starting it costs more wall-clock time than converting an ordinary
document does. Ten documents in one run took 16.7 s against 11.8 s for one - five extra seconds for
nine extra documents. As ten separate runs it would have been about $0.015 rather than $0.0026. Put
the whole folder in the **Documents** field.

The user profile is prebuilt into the image for the same reason. LibreOffice writes one the first
time it starts, and doing that inside the run would add several seconds to every conversion.

Memory is set to 2048 MB rather than the usual 1024 MB because LibreOffice needs a working set of its
own before it opens anything. Apify allocates one CPU core per 4096 MB. A batch does not need more
than a single file, because documents are converted strictly one at a time and each scratch directory
is deleted as soon as its PDF is uploaded.

#### Limits on a single run

| Limit | Value |
|---|---|
| Documents per run | 100 |
| Total input size per run | 512 MB |
| One document | 100 MB |
| Download timeout per file | 2 minutes |
| Conversion timeout per document | 10 minutes |
| ZIP size, past which a manifest is written instead | 192 MB |

A run over any of these says which number it exceeded. The file count is checked before anything is downloaded, so a folder of 5,000 is refused immediately rather than at file 100.

### How to convert Word to PDF with the API

`run-sync` returns the PDF in the response body:

```bash
curl -X POST \
  "https://api.apify.com/v2/acts/marcel-rbro~word-to-pdf/run-sync?token=<TOKEN>" \
  -H 'Content-Type: application/json' \
  -d '{"file": "https://example.com/report.docx"}' \
  --output report.pdf
```

A folder is an array, and `OUTPUT` becomes a ZIP:

```bash
curl -X POST \
  "https://api.apify.com/v2/acts/marcel-rbro~word-to-pdf/run-sync?token=<TOKEN>" \
  -H 'Content-Type: application/json' \
  -d '{"files": ["https://example.com/a.docx", "https://example.com/b.xlsx", "https://example.com/c.pptx"]}' \
  --output documents.zip
```

Asking for an archival PDF is one more field:

```bash
curl -X POST \
  "https://api.apify.com/v2/acts/marcel-rbro~word-to-pdf/run-sync?token=<TOKEN>" \
  -H 'Content-Type: application/json' \
  -d '{"file": "https://example.com/report.docx", "pdfVersion": "pdfa-2b"}' \
  --output report-archival.pdf
```

If you hold the bytes rather than a URL, pass them as base64 in `fileBase64`. The Apify API requires Actor input to be `application/json` and rejects anything else with HTTP 400 before the run starts, so posting the document as a raw request body is not an option:

```bash
curl -X POST \
  "https://api.apify.com/v2/acts/marcel-rbro~word-to-pdf/run-sync?token=<TOKEN>" \
  -H 'Content-Type: application/json' \
  -d "{\"fileBase64\": \"$(base64 < report.docx)\", \"filename\": \"report.docx\"}" \
  --output report.pdf
```

Base64 adds about a third to the payload, so prefer a URL for large files. Pass `filename` with it: for `.txt` and `.csv` the extension is the only thing that says which module should open the file.

`run-sync` waits up to 300 seconds, and **a batch of any size will exceed that long before it exceeds the run's own timeout**. A run converting 100 documents keeps going for as long as it needs; the `run-sync` connection does not. So for anything past a handful of files, start the run with the asynchronous [Run Actor](https://docs.apify.com/api/v2/act-runs-post) endpoint, poll it, and read the results from the dataset and the key-value store when it finishes. `run-sync` is for the one-file case and for small batches.

There are [client libraries for JavaScript and Python](https://docs.apify.com/api/client), and the same run can be triggered on a schedule or from Zapier, Make, n8n, Slack or an MCP client.

### Limitations

- **Fonts are substituted, not invented.** The image carries Liberation, Carlito, Caladea, DejaVu and Noto, which cover Arial, Times New Roman, Courier New, Calibri, Cambria and a wide range of scripts including Chinese, Japanese and Korean. Those substitutes are metric-compatible, meaning the glyph widths match, so line breaks and page counts hold. A document set in a font that is none of those - a licensed corporate typeface, a font you bought - will be rendered in something else, and the shapes will differ even where the spacing does not. There is no way around this short of embedding the font in the source document, which OOXML supports and LibreOffice honours.
- **Macros are not run.** `.docm`, `.xlsm` and `.pptm` convert, but their macros do not execute, so anything a macro would have generated is absent. This is a security property rather than an oversight.
- **Password-protected files fail.** The Actor detects the encryption wrapper and stops with an explanation rather than waiting for a prompt nobody can answer. Remove the protection in Office first.
- **Base and Math are not installed.** The image carries Writer, Calc and Impress only, to keep an already large download from being a much larger one. An embedded Math formula object or a Base report will not render.
- **Spreadsheets convert as they would print.** No print range and no page scaling means a very long PDF. Set them in the source file.
- **Speaker notes are not exported** from presentations, and neither are slide transitions or animations, which a page cannot represent.
- **CSV parsing is fixed, not guessed.** Comma separator, double-quote text delimiter, UTF-8. A semicolon-separated export from a European Excel will land in a single column. Convert it to `.xlsx` first, or re-save it with commas.
- **PDF/A conformance is claimed, not validated.** LibreOffice writes the conformance metadata and follows the profile; this Actor does not run veraPDF over the result. If you need a certificate of validity, validate the output yourself.
- **100 documents and 512 MB of input per run.** Past either, split the batch; the error says which limit was hit. A single document over 100 MB is refused on its own, because LibreOffice loads a file entirely into memory before it can lay it out.
- **Documents are converted one at a time, deliberately.** The image ships a prebuilt LibreOffice user profile so that runs do not pay for creating one, and two `soffice` processes must never share a profile - the second hands its command line to the first and exits reporting success, having converted nothing. Sequential reuse is safe; parallelising it is not. A batch is therefore no faster per document than a single-file run, it just stops paying for startup repeatedly.

### Other file converters

| Actor | Converts |
|---|---|
| **Word to PDF converter** (this one) | DOCX, DOC, ODT, RTF, TXT, XLSX, XLS, ODS, CSV, PPTX, PPT, ODP → PDF |
| [HEIC to JPG converter](https://apify.com/marcel-rbro/heic-to-jpg) | HEIC, HEIF, AVIF → JPEG, PNG, WebP, AVIF, TIFF |
| [MOBI to EPUB converter](https://apify.com/marcel-rbro/mobi-to-epub) | MOBI, PRC, AZW, AZW3 → EPUB |
| [JPG to PDF converter](https://apify.com/marcel-rbro/jpg-to-pdf) | JPG, PNG → PDF |
| [PDF to JPG converter](https://apify.com/marcel-rbro/pdf-to-jpg) | PDF → JPG, PNG |
| [PNG to JPG converter](https://apify.com/marcel-rbro/png-to-jpg) | PNG → JPG, WebP |
| [EPUB to PDF converter](https://apify.com/marcel-rbro/epub-to-pdf) | EPUB → PDF |

### FAQ

#### Is this Word to PDF converter free?

Apify's free plan includes $5 of platform usage per month and needs no card. A document conversion costs a fraction of that; the exact figure is being measured and will appear in the cost section above.

#### Will the formatting survive?

Mostly, and the exceptions are predictable. Text, headings, tables, lists, headers and footers, page numbering and images all come through. What moves is anything that depended on a font the container does not have, and anything Word renders through a feature LibreOffice implements differently - complex text boxes anchored to floating shapes are the usual culprit, along with SmartArt and Word's newer chart types.

The font question is the one that decides most outcomes, which is why the image carries metric-compatible substitutes rather than leaving it to chance. Calibri becomes Carlito, Arial becomes Liberation Sans, Times New Roman becomes Liberation Serif, Cambria becomes Caladea. Those pairs share glyph widths, so a document keeps its line breaks and its page count even though the letterforms are not identical. Anything outside that set is substituted by whatever fontconfig thinks is closest, and the layout can reflow.

If exact fidelity matters more than anything else, embed the fonts in the source document before converting. Word does this from **File → Options → Save → Embed fonts in the file**, and LibreOffice reads them.

#### What is PDF/A, and do I need it?

PDF/A is the ISO profile for long-term archiving. It requires every font to be embedded, forbids external dependencies and features whose rendering has drifted between readers, and records its own conformance level in the file's metadata, so a reader twenty years from now can tell what it is looking at and render it the same way you saw it.

You need it when somebody asks for it: national archives, courts, patent offices, tax authorities and academic repositories generally do. **PDF/A-1b** is the strictest and most widely demanded, **PDF/A-2b** is the sensible modern default, and **PDF/A-3b** additionally allows arbitrary attachments, which is how e-invoicing standards such as ZUGFeRD and Factur-X carry their XML inside the PDF. For an ordinary document you are emailing to somebody, you do not need it, and the file will be smaller without it.

#### Can I convert Excel to PDF without the columns being cut off?

Set the print area, the orientation and the fit-to-width scaling in the source spreadsheet. The conversion produces what Calc would print, so it inherits whatever page setup the workbook carries. A workbook with none set prints at its natural width, which for a wide sheet means columns spilling onto separate pages.

#### Can I convert a PDF back to Word here?

No. This Actor goes one way. PDF to Word is a genuinely different and much harder problem - a PDF records where glyphs sit on a page, not what a paragraph is - and it deserves its own tool rather than a checkbox on this one.

#### Can I batch convert a folder of documents?

Yes, and it is the cheapest way to use it. Select every file in the **Documents** field, or pass an array of URLs to `files` from the API - up to 100 documents per run. Each becomes its own PDF, and all of them are also packed into a single ZIP so there is one download rather than fifty.

The saving is not marginal. This Actor's image is around 1.4 GB, and pulling and starting it takes longer than converting an ordinary document. A folder converted as one run pays that once instead of once per file.

A batch of any real size will outlast the 300-second `run-sync` window, so start it with the asynchronous endpoint and read the dataset when it finishes.

#### What happens if one document in the batch is broken?

That file fails and the rest carry on. Its dataset record gets `ok: false` and an `error` explaining what was wrong - password-protected, damaged, not actually an Office file, a URL that 404ed. The run only fails if nothing converted at all, and the log ends with a count of how many succeeded and how many did not.

#### Can an AI agent call this converter?

Yes. Every Apify Actor is exposed through the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp), so Claude, Cursor and other MCP clients can run this conversion as a tool. The `fileBase64` field exists partly for that case, since an agent holding bytes rather than a public URL is the common situation.

#### The conversion failed. What now?

Turn on `verboseLog` and re-run: the Actor log will carry LibreOffice's own output. The common causes are a password-protected document, a URL that returns an HTML login page rather than the file, and a document whose extension does not match its contents - the Actor reports what it actually detected, which usually explains the last of those on its own.

### Development

```bash
npm install
npm test      # format inspector, batch bookkeeping and ZIP writer; no LibreOffice needed
apify run     # needs soffice on your PATH
```

Conversion runs LibreOffice's `soffice` in headless mode inside a Debian container. `npm test` covers the three pure modules - the format inspector (the zip, OpenDocument and OLE2 parsing that decides which LibreOffice module opens a file), the batch bookkeeping (key collisions and the run's budgets) and the ZIP writer - and deliberately needs no LibreOffice at all, so it runs in a second on any machine. The conversion itself is exercised by the Docker build, which converts a Writer document and a Calc document for real and fails the build if no PDF comes out.

`src/zip.js` is copied from the `pdf-to-jpg` Actor in this family rather than depended on: these Actors have exactly one runtime dependency, `apify`, and PDFs are already compressed, so every archive entry is stored rather than deflated.

This Actor's code is MIT licensed. LibreOffice is MPL-2.0 with LGPL-3 portions and runs as a separate process; the bundled fonts are under the SIL Open Font License, Apache-2.0 and the Bitstream Vera licence - see [THIRD\_PARTY\_NOTICES.md](THIRD_PARTY_NOTICES.md).

# Actor input Schema

## `files` (type: `array`):

The documents to convert. Upload files or paste direct URLs. Each document becomes its own PDF, and several documents are also packed into a ZIP. Accepts .docx, .doc, .odt, .rtf, .txt, .xlsx, .xls, .ods, .csv, .pptx, .ppt and .odp. Password-protected files are not supported.

## `file` (type: `string`):

One document to convert, kept for API callers and saved input configurations that were written before the Documents field existed. Ignored when Documents is filled in.

## `pdfVersion` (type: `string`):

Choose a PDF/A profile when the file has to be readable decades from now: PDF/A embeds every font and forbids anything whose appearance depends on the machine opening it. Archives, courts and tax authorities usually ask for PDF/A-1b or PDF/A-2b. Archival files are larger.

## `outputFilename` (type: `string`):

Name of the resulting file. Defaults to the input filename with a .pdf extension. In a batch this names the ZIP instead, and each PDF keeps its own filename - one name cannot serve fifty documents.

## `exportBookmarks` (type: `boolean`):

Turns the document's headings and bookmarks into PDF outline entries, so a long document stays navigable in a PDF reader's sidebar.

## `imageQuality` (type: `integer`):

JPEG quality used for the images inside the document, from 1 to 100. Lower values make a smaller PDF at the cost of visible artefacts. Has no effect on documents without images.

## `maxImageResolution` (type: `string`):

Downsamples images above this resolution, which is the effective way to shrink a PDF full of photographs. 150 DPI is enough for reading on screen, 300 DPI for printing.

## `fileBase64` (type: `string`):

Alternative to the file field for API callers: the source file encoded as base64. Adds about 33% to the payload size.

## `filename` (type: `string`):

Original filename to use when the file is passed as base64. The extension matters for .txt and .csv, which are otherwise indistinguishable.

## `verboseLog` (type: `boolean`):

Includes the full LibreOffice output in the Actor log. Useful when a conversion produces odd output.

## Actor input object example

```json
{
  "pdfVersion": "default",
  "exportBookmarks": true,
  "imageQuality": 90,
  "maxImageResolution": "0",
  "verboseLog": false
}
```

# Actor output Schema

## `pdfFile` (type: `string`):

The run's OUTPUT record: the PDF itself when one document was converted, or a ZIP of every PDF when several were. This is the same record that the run-sync API endpoint returns in its HTTP response body.

## `allFiles` (type: `string`):

Every record in the run's key-value store: each converted PDF under its own filename, and the ZIP if there was one.

## `conversionDetails` (type: `string`):

One record per input file, with the source format, PDF version, file sizes, download URLs and, for anything that failed, the reason.

# 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 = {};

// Run the Actor and wait for it to finish
const run = await client.actor("marcel-rbro/word-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 = {}

# Run the Actor and wait for it to finish
run = client.actor("marcel-rbro/word-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 '{}' |
apify call marcel-rbro/word-to-pdf --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,marcel-rbro/word-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/08eY4huJtLJVo7qxh/builds/IcYihRy7mEDCOxywz/openapi.json
