# E-book Converter: Word, Markdown & Google Docs to PDF and EPUB (`digitalni.produkty.pro.zivot/ebook-converter`) Actor

Turn a Word (DOCX), Google Docs, Markdown or HTML manuscript into a print-ready PDF and an EPUB e-book with a cover, clickable table of contents and page numbers. For self-publishers, course creators and Amazon KDP. Pay per document.

- **URL**: https://apify.com/digitalni.produkty.pro.zivot/ebook-converter.md
- **Developed by:** [Digitální produkty pro život](https://apify.com/digitalni.produkty.pro.zivot) (community)
- **Categories:** For creators, Automation
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $50.00 / 1,000 document 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

## E-book Converter: Word, Markdown & Google Docs to PDF and EPUB

Turn your manuscript into a **finished e-book in one run**: a **print-ready PDF** and an **EPUB** for e-readers, both with a **cover**, a **clickable table of contents** and proper metadata.

Works with **Word (.docx)**, **Google Docs** share links, **Markdown**, **HTML** and plain text. No Calibre, no LaTeX, no design software.

Made for **self-publishers, course creators, coaches and bloggers** who sell or give away e-books, lead magnets and workbooks.

### What you get

- **PDF**: A4, A5, US Letter or paperback sizes (6×9 in, 5×8 in), justified text with hyphenation, page numbers, a clickable table of contents and PDF bookmarks, with each chapter starting on a new page.
- **EPUB 3** (with an EPUB 2 table of contents for older readers): chapters split automatically at your headings, images embedded, cover included. Ready for Kobo, Apple Books, Google Play Books and Amazon KDP (KDP accepts EPUB uploads).
- **Cover**: use your own image, or get a clean typographic cover with your title, subtitle and author in one of six color themes.
- **Metadata**: title, author and language are stored in both files.

### How to use it

1. Paste one or more **document URLs** (Word, Markdown, HTML), or a **Google Docs link** shared as "anyone with the link", or paste the text directly.
2. Set the **title**, **author** and **language** (e.g. `en`, `cs`, `de`).
3. Choose the **page size** and the **cover**.
4. Run it. Each document becomes one dataset row with links to the **PDF**, **EPUB** and **cover**.

**Chapters come from your headings.** Use Heading 1 / Heading 2 in Word or Google Docs, or `#` / `##` in Markdown. If the document has a single top-level title, chapters are split at the next level.

### Output

```json
{
  "source": "https://docs.google.com/document/d/…/edit",
  "title": "How to Start a Side Business",
  "author": "Jane Doe",
  "sourceType": "docx",
  "chapters": 9,
  "tocEntries": 24,
  "words": 18240,
  "coverUrl": "https://api.apify.com/v2/key-value-stores/<id>/records/01-How-to-Start-a-Side-Business-cover.jpg",
  "epubUrl": "https://api.apify.com/v2/key-value-stores/<id>/records/01-How-to-Start-a-Side-Business.epub",
  "pdfUrl": "https://api.apify.com/v2/key-value-stores/<id>/records/01-How-to-Start-a-Side-Business.pdf",
  "pdfPages": 74
}
```

### Pricing

You pay **per converted document**, PDF and EPUB included. Documents that fail to download or convert are not charged.

### Use cases

- **Self-publishing**: an EPUB for Kobo, Apple Books or KDP plus a PDF for direct sales on Gumroad, Shopify or your website.
- **Online courses**: turn lesson notes into a downloadable workbook.
- **Lead magnets**: a polished PDF guide from a Google Doc in a minute.
- **Documentation and reports**: Markdown docs to a shareable PDF with a table of contents.
- **Automation**: regenerate the book from Google Docs on a schedule or from Make, Zapier or n8n.

### How to use it via API

```python
from apify_client import ApifyClient

client = ApifyClient("<YOUR_API_TOKEN>")
run = client.actor("digitalni.produkty.pro.zivot/ebook-converter").call(run_input={
    "documentUrls": ["https://docs.google.com/document/d/<DOC_ID>/edit"],
    "author": "Jane Doe",
    "language": "en",
    "pageSize": "6x9",
})
for book in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(book["pdfUrl"], book["epubUrl"])
```

### Good to know

- Old `.doc` files are not supported. Save them as `.docx` first.
- Formatting comes from the document structure (headings, lists, bold, italics, tables, images), not from exact Word fonts and spacing. The result uses one consistent book style.
- Images inside Word documents are kept. Images in Markdown/HTML are downloaded if they are publicly reachable.
- Private Google Docs cannot be read. Share the document as "anyone with the link can view".
- Only convert content you have the rights to publish.

### More tools from the same developer

All tools with code examples: [github.com/Phenixik/apify-actors](https://github.com/Phenixik/apify-actors)

- [PDF Text Extractor](https://apify.com/digitalni.produkty.pro.zivot/pdf-text-extractor): text, Markdown and RAG chunks from PDFs
- [RSS Feed Reader & Monitor](https://apify.com/digitalni.produkty.pro.zivot/rss-feed-reader): only-new-items feed monitoring
- [Career Site Jobs API](https://apify.com/digitalni.produkty.pro.zivot/ats-jobs): search 400,000+ jobs from 11,000+ company career sites
- [App Store Reviews](https://apify.com/digitalni.produkty.pro.zivot/app-store-reviews): iOS reviews from 50+ countries
- [remove.bg API Alternative](https://apify.com/digitalni.produkty.pro.zivot/removebg-api-dropin): drop-in replacement for the remove.bg API, change one URL
- [AI Background Remover](https://apify.com/digitalni.produkty.pro.zivot/background-remover): bulk transparent PNGs, white backgrounds and masks
- [Product Photo Prep](https://apify.com/digitalni.produkty.pro.zivot/product-photo-prep): white-background, square photos for Shopify, Amazon and Etsy
- [AI Image Upscaler](https://apify.com/digitalni.produkty.pro.zivot/ai-image-upscaler): 2x / 4x Real-ESRGAN upscaling, no GPU
- [App Icon & Screenshot Generator](https://apify.com/digitalni.produkty.pro.zivot/app-icon-generator): every iOS, Android and PWA icon size from one image
- [Website Screenshot](https://apify.com/digitalni.produkty.pro.zivot/website-screenshot): full-page, mobile and PDF screenshots
- [Sitemap URL Extractor](https://apify.com/digitalni.produkty.pro.zivot/sitemap-url-extractor): every URL from a website's sitemaps
- [Broken Link Checker](https://apify.com/digitalni.produkty.pro.zivot/broken-link-checker): find 404s and dead links on your site
- [PageSpeed & Lighthouse Audit](https://apify.com/digitalni.produkty.pro.zivot/pagespeed-audit): bulk Core Web Vitals and SEO scores
- [Domain WHOIS & DNS Lookup](https://apify.com/digitalni.produkty.pro.zivot/domain-whois-lookup): expiry, DNS, SPF/DMARC and SSL for many domains

**Need a custom tool?** I build custom Apify Actors, scrapers, data feeds and automations, and adapt existing Actors to your workflow. Write to digitalniproduktyprozivot@email.cz or open an issue on the Issues tab.

### Questions or ideas?

Open an issue on the **Issues** tab. Feature requests (custom fonts, print-ready paperback interiors with mirrored margins, DOCX output…) are welcome.

# Actor input Schema

## `documentUrls` (type: `array`):

Word (.docx), Markdown (.md), HTML or text files. Google Docs, Google Drive and Dropbox share links work too (the document must be shared as "anyone with the link"). One book per URL.

## `text` (type: `string`):

Paste the whole book in Markdown or plain text. Use # for the title and ## for chapters.

## `title` (type: `string`):

Book title. Leave empty to use the first heading of the document.

## `subtitle` (type: `string`):

Shown on the generated cover.

## `author` (type: `string`):

Shown on the cover and stored in the PDF and EPUB metadata.

## `language` (type: `string`):

Language code like en, cs, de, es, fr. Used for hyphenation, the table of contents heading and e-reader metadata.

## `outputFormats` (type: `array`):

One or both. The price per document is the same.

## `coverImageUrl` (type: `string`):

Optional: your own cover (JPEG, PNG or WebP, ideally 1600×2400 px). Leave empty to generate one.

## `generateCover` (type: `boolean`):

When there is no cover image, create a clean typographic cover with the title, subtitle and author.

## `coverColor` (type: `string`):

Background color of the generated cover.

## `pageSize` (type: `string`):

PDF page size

## `fontSizePt` (type: `integer`):

Body text size in the PDF.

## `includeToc` (type: `boolean`):

Clickable table of contents after the cover. The EPUB always has one.

## `tocDepth` (type: `integer`):

1 = chapters only, 2 = chapters and sections, 3 = also subsections.

## `pageNumbers` (type: `boolean`):

Page numbers at the bottom of each PDF page (not on the cover).

## `maxFileSizeMb` (type: `integer`):

Maximum document size (MB)

## Actor input object example

```json
{
  "text": "# My First E-book\n\n## Chapter 1: Getting started\n\nWrite your book in **Markdown**, Word or Google Docs. This tool turns it into a PDF and an EPUB with a cover and a table of contents.\n\n- Bullet lists\n- *Italics* and **bold**\n- Tables and images\n\n## Chapter 2: Publishing\n\nUpload the EPUB to Amazon KDP, Kobo or Google Play Books, and sell the PDF on Gumroad, Shopify or your own website.\n\n> Tip: replace this text with your own book or add document URLs above.\n",
  "language": "en",
  "outputFormats": [
    "pdf",
    "epub"
  ],
  "generateCover": true,
  "coverColor": "navy",
  "pageSize": "A4",
  "fontSizePt": 11,
  "includeToc": true,
  "tocDepth": 2,
  "pageNumbers": true,
  "maxFileSizeMb": 50
}
```

# Actor output Schema

## `books` (type: `string`):

Links to the PDF, EPUB and generated cover, page and word counts.

## `summary` (type: `string`):

Counts of converted and failed documents with reasons.

# 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 = {
    "text": `# My First E-book

## Chapter 1: Getting started

Write your book in **Markdown**, Word or Google Docs. This tool turns it into a PDF and an EPUB with a cover and a table of contents.

- Bullet lists
- *Italics* and **bold**
- Tables and images

## Chapter 2: Publishing

Upload the EPUB to Amazon KDP, Kobo or Google Play Books, and sell the PDF on Gumroad, Shopify or your own website.

> Tip: replace this text with your own book or add document URLs above.`
};

// Run the Actor and wait for it to finish
const run = await client.actor("digitalni.produkty.pro.zivot/ebook-converter").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 = { "text": """# My First E-book

## Chapter 1: Getting started

Write your book in **Markdown**, Word or Google Docs. This tool turns it into a PDF and an EPUB with a cover and a table of contents.

- Bullet lists
- *Italics* and **bold**
- Tables and images

## Chapter 2: Publishing

Upload the EPUB to Amazon KDP, Kobo or Google Play Books, and sell the PDF on Gumroad, Shopify or your own website.

> Tip: replace this text with your own book or add document URLs above.
""" }

# Run the Actor and wait for it to finish
run = client.actor("digitalni.produkty.pro.zivot/ebook-converter").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 '{
  "text": "# My First E-book\\n\\n## Chapter 1: Getting started\\n\\nWrite your book in **Markdown**, Word or Google Docs. This tool turns it into a PDF and an EPUB with a cover and a table of contents.\\n\\n- Bullet lists\\n- *Italics* and **bold**\\n- Tables and images\\n\\n## Chapter 2: Publishing\\n\\nUpload the EPUB to Amazon KDP, Kobo or Google Play Books, and sell the PDF on Gumroad, Shopify or your own website.\\n\\n> Tip: replace this text with your own book or add document URLs above.\\n"
}' |
apify call digitalni.produkty.pro.zivot/ebook-converter --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,digitalni.produkty.pro.zivot/ebook-converter"
        }
    }
}
```

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/mXeIPzxa31K2cULqS/builds/QM4sKSn4h6wsBCcfL/openapi.json
