Aldleaf

Aldleaf · PDF to EPUB, done properly

Every printed leaf, rewritten as EPUB.

For authors, writers and publishers who self-publish. Aldleaf is a free, open-source PDF to EPUB converter. It reads the layout of your text-based PDF book and builds a clean, validated EPUB 3 you can publish on any platform you choose. It works out what each font is for, finds the chapters and reads the page numbers, then checks every letter against the PDF. Writing in Word or another editor? Export your final print-ready version as a PDF first.

REAL Rating 3 (2026): Moderate AIREAL Rating 3 · Moderate AI
AI assisted building blocks under the author's direction
A fixed PDF page goes through analyze, confirm, build and check, and comes out as a reflowing ebook in light and dark themes.

About the name

Aldleaf (say "ALD-leaf"; earlier pdf2epub-kit) is named after the Aldine leaf ❦, the printer's leaf ornament of Aldus Manutius, the Renaissance printer who gave us the pocket book and italic type. Printers used it to mark a new section, much like the scene breaks Aldleaf keeps from your print edition. The leaf in the logo is the ❦ from Noto Sans Symbols 2 (SIL Open Font License 1.1).

Who it's for

Authors, writers and publishers who self-publish, and who have a print-ready PDF but no proper ebook.

Self-publishing authors and writers

You laid out your book for print (InDesign, Affinity, Word, Vellum, Scribus, LaTeX) and want an ebook without paying for a conversion or retyping it.

Small and independent publishers and presses

Turn your back catalogue and new print files into consistent, accessible EPUBs.

Anthology, magazine and competition organisers

Collections with many authors, bylines, dedications and content warnings.

Editors and book designers

You hand over both the print files and the ebook.

Publish anywhere. The output is a standard, validated EPUB 3, the format the main stores and distributors accept: Amazon KDP, Apple Books, Kobo Writing Life, Google Play Books, Barnes & Noble Press, aggregators such as Draft2Digital, or direct sales from your own website or shop. Check each store's current upload requirements before you publish.

Readers can also use it on their own DRM-free copy of a book, for their own devices. It is not for converting or sharing books you don't have the rights to.

How it works

One-click converters flatten a PDF into lines. Aldleaf measures it, shows you what it found, and only builds once you agree.

1

Analyze

Measures spacing, indents and margins, works out the role of every font@size, finds sections, bylines and page numbers.

2

Confirm

Everything lands in one readable config file. Fix a role, a title or the language; nothing is hidden in code.

3

Build

Semantic XHTML, EPUB 3 navigation, page list, NCX fallback, accessibility metadata, cover and optional fonts.

4

Check

EPUBCheck, every letter of every section compared with the PDF, page-marker coverage, lints and side-by-side screenshots.

From print layout to a real ebook

Running heads, page numbers and hard line breaks are removed by position. Paragraphs split across pages are rejoined. Chats, emails and on-screen text become real, labelled text.

A PDF page with chat bubbles and an email next to the EPUB version on two phones.
Synthetic sample book. Every word in the samples is invented filler.

Stamps and badges follow the reader's theme

Grey vector artwork such as rating stamps, logos and ornaments becomes an inline SVG painted in the reader's text colour. It stays sharp, has no white box, and turns light in night mode. Kindle gets a transparent PNG fallback. Colour art stays a picture.

Set art: png in the config to keep every piece of artwork as a picture.
The same story opening in a day theme and a night theme; the stamp is dark on light and light on dark.

Adapts to the book, not the other way round

Nothing is tuned to one title. The profile is measured from each PDF and written into the config.

Four phones: a novel with a drop cap, an anthology story opener, nonfiction with lists and a footnote, and a poem in night mode.

Novels

First-line indents or spaced paragraphs, justified or ragged-right, drop caps, "Chapter 1" + title headings. Layout hyphens are removed and real compounds kept.

Anthologies

Per-story bylines, dedications and content-warning boxes. Story authors become contributors in the metadata.

Nonfiction

Subheadings, bullet and numbered lists, footnotes turned into pop-up notes linked both ways.

Poetry

Every line break and stanza kept as set.

Scene breaks as the author set them

Their own printed marker or blank space, never added or removed by a rule. Prefer one ornament everywhere? scene_breaks: ornament.

Print page numbers

Every page gets a marker, including unnumbered chapter openers. Apple Books shows the print numbers, so readers can cite them.

Books in your language

Any language written horizontally, left to right. Aldleaf never translates your text. It detects the language and sets it in the EPUB, recognises chapter labels, bylines and content warnings in that language, and writes its own few labels in it too.

Chapter openers in Hindi, Japanese, Korean, Russian, Bengali, Chinese, French and Tamil on eight phones.
Sample books with invented text, converted by Aldleaf.

The language is detected for you

From the PDF, the script and the words. Readers, stores and screen readers need it for the right fonts, hyphenation and pronunciation. Chinese, Japanese and Thai lines are joined without adding spaces, and a damaged PDF text layer is repaired where safe or reported. 27 languages tested word for word, each as an anthology, a novel, nonfiction and poetry.

Planned next: right-to-left books (Urdu, Arabic, Persian, Hebrew), vertical Chinese and Japanese text, and books in more than one language, such as bilingual editions, translations next to the original or a mythology retelling that quotes the original verses.
A table of ten sample books with the detected language code, the contents heading Aldleaf wrote, and all checks passed.

It checks its own work

Each build writes a QA report. It compares letters rather than words, so drop caps and removed hyphens don't hide a missing line.

CheckWhat it catches
EPUBCheckAnything Apple Books or Send to Kindle would reject
CompletenessLost or duplicated text, per section
Page markersPrint pages without a marker
LintsLeftover page numbers, unjoined wraps, missed paragraph breaks
--referenceStructural differences from a hand-made edition (no text compared)
--visualSide-by-side PDF and EPUB screenshots
Terminal output of aldleaf convert ending with: all checks passed.

Install and run

Start from a PDF. Aldleaf reads PDF files only for now. If your book is in Word, Pages, Google Docs, Scrivener or another editor, first export your final, edited, print-ready version as a PDF (for example File → Save As → PDF), then convert that PDF.

Python 3.10+. EPUBCheck needs Java.

pip install git+https://github.com/5aahil/aldleaf-pdf2epub
aldleaf fetch-epubcheck

aldleaf analyze book.pdf        # writes book.aldleaf.yaml: review it
aldleaf build book.pdf          # book.epub + book_QA.txt
# or both at once:
aldleaf convert book.pdf --cover cover.jpg

Then open the EPUB in Apple Books, or upload it at Send to Kindle. The config reference explains every option.

Works with Claude

The companion Claude skill aldleaf (shortcuts: pdf2epub and pdf-to-epub) runs the whole loop with you. It analyses the PDF, checks the proposed config against rendered pages, builds and checks the EPUB, and hands over the result with a device checklist.

Claude Code:

/plugin marketplace add 5aahil/aldleaf-pdf2epub
/plugin install aldleaf@aldleaf

# then run one of:
/aldleaf:aldleaf
/aldleaf:pdf2epub
/aldleaf:pdf-to-epub

Claude app: download aldleaf-skill.zip, then go to Customize → Skills → + → Upload a skill. Code execution must be on. Read the skill first.

Rights and privacy

For authors and publishers converting their own books, and readers converting their own copy for their own devices. Copy-protected PDFs are refused. Buyer stamps are left out unless you pass --stamp. PDFs, EPUBs and configs are never committed: CI enforces it. Aldleaf collects no data: no accounts, no analytics, no server. Read the privacy policy.

Not in scope (yet)

Word, Pages and other editor files (export a PDF first), scanned PDFs without a text layer (detected and refused), multi-column body text, large tables and maths, right-to-left scripts (Arabic, Hebrew, Persian, Urdu) and vertical Chinese or Japanese text (both detected and refused with a clear message, and planned next), and copy-protected PDFs (refused).

AI disclosure

REAL Rating 3 (Moderate AI), self-assessed on Real Good AI's REAL Rating scale. AI assisted building-block components (code, documentation and illustrations) under the author's direction. The author defined the requirements and design, tested the toolkit against real books, reported and checked the fixes, and made the final decisions.

REAL Rating 3 (2026): Moderate AI