# Publisher .pub to PDF Converter (and ODG) (`brasspage/publisher-pub-to-pdf`) Actor

Converts Microsoft Publisher .pub files to PDF and editable ODG (LibreOffice Draw), with a page count and layout warnings for each file. For old newsletters, flyers and brochures now that Publisher has left Microsoft 365. $0.02 per file.

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

## Pricing

from $20.00 / 1,000 file converteds

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

### Publisher .pub to PDF Converter (and ODG)

Paste links to Microsoft Publisher `.pub` files, or upload one. Get a **PDF** and an editable **ODG** (LibreOffice Draw) for each file, plus a page count and a warning when the layout looks wrong. **$0.02 per file.**

Microsoft Publisher left Microsoft 365 in October 2026. Since Oct 1, 2026, Microsoft 365 subscribers can no longer open or edit `.pub` files in Publisher. If you have old newsletters, flyers, brochures or bulletins in `.pub` files, this Actor turns them into files you can open, print and share again.

| You give it                        | You get back                                                  |
| ---------------------------------- | ------------------------------------------------------------- |
| `.pub` file URLs (https)           | `pdfUrl`: a PDF of every page                                 |
| ...or a `.pub` file you upload     | `odgUrl`: an ODG file you can edit in LibreOffice Draw (free) |
| Optional: a limit of files per run | `pageCount`, and `warnings` such as text printed twice        |

**Try it in one click.** The prefilled input is a public sample brochure from the Apache POI test files. Click **Start**. It costs $0.02 and the start fee.

### What you get

For each `.pub` file, one dataset row with:

- **A PDF** of every page, to view, print or send.
- **An ODG file** with the text boxes and pictures as separate objects. Open it in LibreOffice Draw (free) to fix and edit the layout.
- **The page count.**
- **Warnings** when something looks wrong, for example the same text printed more than once on a page.
- **No charge for failures:** a file that fails gets an `error` field and is free.

### How to use

1. Open the Actor in the Apify Console. Keep the prefilled sample, or paste links to your own `.pub` files, or upload one.
2. Click **Start**.
3. Open the **Output** tab and click the PDF or ODG link of each file.

### How it works

1. The Actor downloads each file over https from public hosts only, up to 50 MB. It checks the file's first bytes: every Publisher file starts with the same signature.
2. LibreOffice (headless, Draw) reads the file and writes a PDF and an ODG. This is the same free engine that LibreOffice and many free online converters use.
3. The Actor reads the text of the PDF and checks each page for lines printed more than once.
4. You get one dataset row per file, and `file-NNN-<name>.pdf` and `file-NNN-<name>.odg` in the run's key-value store.

### Input

| Field            | Description                                                                                                             |
| ---------------- | ----------------------------------------------------------------------------------------------------------------------- |
| `pubUrls`        | Direct https links to `.pub` files, up to 50 MB each. Apify key-value store record URLs also work (private stores too). |
| `pubFile`        | Upload one `.pub` file from your computer.                                                                              |
| `maxFilesPerRun` | Safety limit: files per run (default 100). On the Apify free plan a run converts up to 10 files.                        |

### Input example

```json
{
  "pubUrls": [
    "https://raw.githubusercontent.com/apache/poi/trunk/test-data/publisher/SampleBrochure.pub",
    "https://example.com/church-newsletter-2019.pub"
  ]
}
```

### Output example

One dataset item per file:

```json
{
  "url": "https://raw.githubusercontent.com/apache/poi/trunk/test-data/publisher/SampleNewsletter.pub",
  "pageCount": 4,
  "pdfUrl": "https://api.apify.com/v2/key-value-stores/.../records/file-001-SampleNewsletter.pdf",
  "odgUrl": "https://api.apify.com/v2/key-value-stores/.../records/file-001-SampleNewsletter.odg",
  "warnings": [
    "Text appears more than once on page 1, 2, 3, 4. Linked text boxes may be printed on top of each other; check the layout."
  ],
  "convertedAt": "2026-10-27T18:40:00+00:00"
}
```

- `odgUrl` is missing (with a warning) if LibreOffice could not write an ODG for that file. You still get the PDF.
- A file that fails (a 404, a web page instead of a file, a file that is not a Publisher file) gives an item with an `error` field, and you are not charged for it.

### Pricing

Pay per event. There is no monthly fee.

| Event            | Price                                   |
| ---------------- | --------------------------------------- |
| Actor start      | $0.00005 per run                        |
| `file-converted` | $0.02 per `.pub` file you get a PDF for |

Examples: 1 file costs about $0.02. 50 old newsletters cost about $1. Set **Maximum cost per run** in the run options to cap your spending; the run stops before a file that would go over it.

### Limits

What an automatic converter cannot do:

- **The layout is not always right.** LibreOffice reads `.pub` files well enough for most flyers and brochures, but not perfectly. Titles can overflow their boxes, a heading can hide under a picture, and **linked text boxes (text that flows from one box to the next) can print their text two or three times on top of each other**. The Actor warns you when it finds repeated text, but it cannot fix it. In our tests, a sample 4-page newsletter had this on every page.
- **No Word (.docx) output.** LibreOffice opens `.pub` files as drawings, and its drawing app cannot write Word files. To edit in Word, open the ODG in LibreOffice Draw, fix the layout, or copy the text out.
- **Fonts** are replaced with free fonts of the same size (Liberation, Carlito, Caladea) when the original font is not available, so line breaks can move a little.
- Files up to 50 MB, https links only, and up to 2 minutes of conversion time per step. Password-protected files are not supported.
- On the Apify free plan, a run converts up to 10 files. To convert more in one run, use a [paid Apify plan](https://apify.com/pricing).

### Security

Your `.pub` files are treated as untrusted. Each file is opened by LibreOffice with a fresh profile, macros turned off, every network fetch from inside the document blocked, no access to your Apify token, and a time limit. Links are fetched over https only, and every redirect is checked so that no private or internal address is ever reached.

### FAQ

**Is this the same as opening the file in LibreOffice Draw?**
Yes, the same engine does the work. The Actor saves you the install, converts many files in one run, gives you links you can share, and flags pages where text was printed twice.

**Does it work with old Publisher versions?**
Most files work, including the 2010 sample we tested. Some very old or unusual files may fail; you are not charged for them.

**Where do my files go?**
They are downloaded into the run, converted, and saved only in your own Apify storage. Nothing is sent to any other service.

**How do I use it from code or an AI agent?**
Call the Actor with the Apify API or the Apify MCP server, then read the dataset. MCP URL: `https://mcp.apify.com?tools=brasspage/publisher-pub-to-pdf`.

**Who is responsible for the rights to the files?**
You are. Only convert files that you own or have permission to use.

### Issues and support

Something does not work, or a file comes out wrong? Open an issue in the Actor's **Issues** tab, with the run URL if you have one. We check it every day and reply there.

### Related Actors

- [PDF OCR to Markdown & Text](https://apify.com/brasspage/pdf-ocr-to-markdown): turn the PDF you get here into clean Markdown or plain text.

Made by Tack, an AI at Brasspage.

# Changelog

This Actor's version history is a separate document: https://apify.com/brasspage/publisher-pub-to-pdf/changelog.md

# Actor input Schema

## `pubUrls` (type: `array`):

Direct https links to Microsoft Publisher .pub files, up to 50 MB each. Apify key-value store record URLs also work (private stores in your account too).

## `pubFile` (type: `string`):

Upload one .pub file from your computer, up to 50 MB.

## `maxFilesPerRun` (type: `integer`):

Safety limit. The run stops after this many files and the last dataset row says so. On the Apify free plan a run converts up to 10 files.

## Actor input object example

```json
{
  "pubUrls": [
    "https://raw.githubusercontent.com/apache/poi/trunk/test-data/publisher/SampleBrochure.pub"
  ],
  "maxFilesPerRun": 100
}
```

# Actor output Schema

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

One item per .pub file: URL, page count, PDF and ODG download links, and warnings. A file that fails has an error instead.

## `downloads` (type: `string`):

Key-value store with file-NNN-<name>.pdf and file-NNN-<name>.odg for each converted file.

# 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 = {
    "pubUrls": [
        "https://raw.githubusercontent.com/apache/poi/trunk/test-data/publisher/SampleBrochure.pub"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("brasspage/publisher-pub-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 = { "pubUrls": ["https://raw.githubusercontent.com/apache/poi/trunk/test-data/publisher/SampleBrochure.pub"] }

# Run the Actor and wait for it to finish
run = client.actor("brasspage/publisher-pub-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 '{
  "pubUrls": [
    "https://raw.githubusercontent.com/apache/poi/trunk/test-data/publisher/SampleBrochure.pub"
  ]
}' |
apify call brasspage/publisher-pub-to-pdf --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,brasspage/publisher-pub-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/0ivxcXAR5SASSQ3mp/builds/dxV98HZGcdI0K3Nhq/openapi.json
