induwara.lk
induwara.lkDocuments · Privacy-first

EPUB to PDF Converter

Convert any EPUB e-book to a printable PDF entirely in your browser. The spine order, chapter titles, and inline images are preserved; the file never leaves your device. Pick page size, font, and margin — sources cited below.

By Induwara AshinsanaUpdated May 11, 2026
EPUB to PDF ConverterIn-browser · no upload
Files stay on your device

Everything happens in your browser. Nothing is uploaded.

Built against the W3C EPUB 3.3 specification, PKWARE's APPNOTE.TXT (ZIP), and the WHATWG Compression Streams API. Sources verified 2026-05-11. The full list is in the “Sources & references” section below.

How it works

An EPUB is a ZIP archive containing XHTML chapter files, optional CSS, fonts, and images, plus a small set of XML manifests that describe the reading order. The W3C's EPUB 3.3 Recommendation locks down the structure: the first file in the archive is the uncompressed text application/epub+zip (the OCF mimetype sentinel), then META-INF/container.xml points at the OPF package document, and the package document's spine declares the chapter order. This tool walks that structure deterministically:

  1. Read the ZIP central directory. A handwritten parser locates the End-of-Central-Directory record by scanning backward from the end of the file (PKWARE APPNOTE.TXT §4.3.16), then walks each Central Directory File Header to enumerate the entries. ZIP64 containers are flagged with a friendly error instead of silently mis-parsed.
  2. Decompress entries on demand. The browser's native DecompressionStream("deflate-raw") handles compression method 8 (DEFLATE) — the only compressed method EPUBs use. Stored entries (method 0, including the mimetype sentinel) are copied byte-for-byte. No third-party ZIP library is loaded.
  3. Parse the OPF spine. The package document's <manifest> lists every resource in the book; the <spine> lists the reading order. Items with linear="no" are excluded — those are typically pop-up notes the reader does not want printed.
  4. Stitch the chapters into one document. Each chapter's body content is concatenated into a single HTML document with a CSS Paged Media @page rule for the chosen size and margin. Scripts, custom CSS, and event-handler attributes are stripped so nothing executes inside the sandboxed preview iframe; a curated print stylesheet replaces them so the output is consistent across books.
  5. Print to PDF natively. The assembled document is rendered in a sandboxed same-origin iframe, and iframe.contentWindow.print() opens the browser's print dialog. Picking Save as PDF writes the PDF directly to disk — selectable text, working hyperlinks, no rasterisation.

Two independent estimators compute the expected page count: a layout formula based on the chosen page size, font size, and margin, and a density formula tuned to the canonical 250-words-per-A5-page ratio that publishers use for paperback planning. Both numbers are shown above. When they disagree by more than 30%, the UI flags it so you can sanity-check before printing.

Worked examples

Scenario

Short-story collection (5,000 words)

A pocketbook collection set on A5 portrait at 11 pt with 18 mm margins — the format most printed paperbacks use.

  1. Words: 5,000
  2. Page: A5 portrait, 18 mm margin, 11 pt
  3. Layout estimate: 17 pages
  4. Density cross-check: 20 pages
  5. Reading time: ~25 minutes at 200 wpm
  6. Estimators agree within 30% — page count is reliable.

Scenario

Standard-length novel (80,000 words)

A typical adult novel printed on A5 portrait at 11 pt. The layout formula and density formula give different answers — both are reported so the reader can sanity-check.

  1. Words: 80,000
  2. Page: A5 portrait, 18 mm margin, 11 pt
  3. Layout estimate: 270 pages
  4. Density cross-check: 320 pages
  5. Reading time: ~400 minutes at 200 wpm
  6. Estimators agree within 30% — page count is reliable.

Scenario

University textbook (250,000 words)

A long-form textbook set on A4 portrait at 11 pt with 18 mm margins. Edge case for the estimators — both should still agree within the 30% band.

  1. Words: 250,000
  2. Page: A4 portrait, 18 mm margin, 11 pt
  3. Layout estimate: 365 pages
  4. Density cross-check: 430 pages
  5. Reading time: ~1,250 minutes at 200 wpm
  6. Estimators agree within 30% — page count is reliable.

Frequently asked questions

Sources & references

Related tools

Rate this tool
Be the first to rate

Comments & feedback

Spotted a bug or want an improvement? Tell us — our team reviews every comment, and good ideas get built. Comments are public and anonymous.

Found an EPUB the converter chokes on, or a feature it should support?

Email me at [email protected] — most fixes ship within 24 hours.