Table of Contents
If you’ve ever tried converting a PDF to EPUB, you’ve probably hit some of these:
- Page numbers appearing randomly in the middle of a paragraph
- Two-column layouts squashed into one, with the reading order scrambled
- Footnotes that vanished — or got pasted straight into the body text
- Headers and footers that never got stripped, repeating on every chapter
This isn’t your fault, and it isn’t because one particular tool is bad. It’s caused by the PDF format itself.
PDF and EPUB: Two Opposite Design Philosophies
To understand the problem, you first have to understand what a PDF actually is.
PDF stands for Portable Document Format. Its design goal is to look exactly the same on every device. To pull that off, PDF pins every character, line, and image to precise coordinates on the page. Internally, a PDF looks roughly like this:
BT
/F1 12 Tf
72 720 Td
(This is a heading) Tj
ET
BT
/F2 10 Tf
72 700 Td
(This is paragraph text that continues...) Tj
ET
Notice: there’s no “heading,” no “paragraph,” no “footnote.” Just fonts, coordinates, and text. A PDF has no idea which line is a title and which is body copy — it only knows to “place a 12pt string at coordinate (72, 720).”
EPUB is the exact opposite. EPUB is a semantic, structured document, and underneath it’s HTML:
<h1>This is a heading</h1>
<p>This is paragraph text that continues...</p>
<aside class="footnote">This is a footnote</aside>
EPUB doesn’t care where text sits on the screen — that’s the reader app’s job. EPUB only cares about what role each piece of text plays: heading, body, footnote, table.
So converting PDF to EPUB really means: reconstructing a document’s semantic structure out of a pile of coordinate data.
That’s why it’s so hard.
How Do Traditional Converters Do It?
Take Calibre as an example (it’s the most popular free converter, and the Calibre team themselves note in their docs that PDF is a “very, very bad” input format).
A traditional converter’s workflow looks roughly like:
- Parse the PDF’s internal structure, pulling coordinates and font info for every text block
- Infer semantics with rules — “if the font is 14pt and bold, it’s probably a heading”
- Order the reading flow by coordinates — left to right, top to bottom
- Assemble it into EPUB
This logic works for simple documents. A plain-text novel with a uniform font size and single-column layout usually converts fine.
But real-world PDFs are rarely that simple:
Multi-column layouts: Academic papers and magazines often use two or three columns. A traditional converter reading left-to-right by coordinate will splice the first line of column one onto the first line of column two — and the whole paragraph turns to nonsense.
Headers and footers: Every page has a page number, chapter name, author name. The converter can’t tell these “repeating decorative bits” apart from the body. You end up with “Page 42” suddenly dropped into the middle of a sentence.
Footnotes: In a PDF, a footnote is just small text at the bottom of the page. The converter doesn’t know it’s a footnote, so it treats it as the start of the next paragraph and splices it right in.
Paragraphs that span pages: A paragraph starts at the bottom of page 3 and ends at the top of page 4. Traditional converters sometimes break it into two unrelated chunks of text.
These aren’t bugs — they’re the fundamental limit of rule-based inference. Rules can only cover the cases you anticipated, and the diversity of document layouts vastly exceeds any rule set.
Why Can AI Do Better?
pdf2epub.ai takes a completely different approach: instead of parsing the PDF’s internal data structure, it “looks” at each page the way a human does.
Concretely, the conversion works like this:
Step 1: Render each PDF page to an image
We render each PDF page to an image at 200 DPI. This step sidesteps the complexity of the PDF’s internals entirely — no matter how the PDF was made (exported from Word, compiled from LaTeX, or scanned), what it ultimately presents is an image.
Step 2: A multimodal AI “reads” the page
We use Google’s Gemini Flash model to process these page images. Gemini is a multimodal large language model that understands images and text at the same time.
Unlike traditional OCR, Gemini isn’t recognizing “what each character is” — it’s understanding “what content is on this page and how it relates.” It can tell that:
- The large bold text at the top of the page is a chapter heading, not just “14pt bold”
- The small text below a horizontal rule at the bottom is a footnote, not “a paragraph at the end of the page”
- In a two-column layout, the left column should be read top to bottom before the right column
- Page numbers and headers are decorative elements that should be ignored
- Watermarks and ad banners should be automatically removed
This ability isn’t hand-coded with rules — it’s “visual comprehension” the model learned from training on a vast range of documents.
Step 3: Smart merging with context awareness
For long documents (say, a 300-page textbook), we don’t just staple each page’s output together. Every 40 pages forms a batch, merged intelligently with the Gemini Pro model while injecting this context:
- The full table of contents: the AI knows which chapter the current content belongs to
- A summary of the previous batch: prevents duplicate or broken content across batch boundaries
- Heading hierarchy rules: keeps the heading structure consistent across the whole book
- A style guide: document style rules auto-extracted from the first batch
This means even when a chapter straddles two batch boundaries, the AI stitches it together correctly — because it knows the context.
Step 4: Auto-generating a navigable table of contents
Based on the extracted chapter structure, we automatically generate the EPUB’s navigable TOC. In your reader you can tap a chapter to jump straight to it, just like a native ebook.
Real-World Comparison
| Problem | Traditional converter | pdf2epub.ai |
|---|---|---|
| Page numbers in body text | Common | Auto-removed |
| Scrambled multi-column order | Almost guaranteed | AI reads columns in correct order |
| Footnotes merged into body | Common | Detected as footnotes, placed correctly |
| Leftover headers/footers | Needs hand-written regex per book | Auto-detected and removed |
| Broken cross-page paragraphs | Common | Merged with context awareness |
| Table of contents | Missing or manual | Auto-generated, navigable |
When Don’t You Need AI Conversion?
Honestly: if you’re converting a simply-formatted plain-text novel, Calibre is more than enough, and it’s free. There’s no need to pay for AI to convert a simple novel.
But if your PDF has multi-column layouts, footnotes, tables, formulas, or code blocks — or it’s a scanned document — those are exactly the cases where traditional tools fall apart, and where AI conversion earns its keep.
Try it yourself: pdf2epub.ai gives you free credits on signup, so convert a few pages and judge the quality before you commit.