Feature · Document engine

EPUB in. PDF and EPUB out. Structure survives.

Book Fork reads both formats into one canonical document model, so translation, review and export never branch on where the book came from — and a rebuilt book still looks like a book.

One canonical document, two formats.

EPUB and PDF are parsed into the same model: metadata, sections, text blocks, images and links, each with deterministic ids (section_003, block_0041) and a source anchor. Array position is not the only identity, so a resumed job still knows which block is which.

Translatable text keeps its inline markup. A placeholder protector strips URLs, emails, tags and code into opaque tokens before text reaches a model and restores them afterwards — the pipeline never trusts an instruction alone to preserve a link.

What is preserved.

Reading structure

Spine and chapter order, headings, paragraphs, lists, quotes, captions, tables, images and links — carried through to the export.

Inline formatting

Bold, italics and links inside a sentence stay attached to the words they belong to, not flattened to plain text.

A real contents page

The exported PDF carries a contents page with printed page numbers, running heads, page numbers and a clickable outline. The EPUB gets an EPUB 3 nav and a legacy toc.ncx.

The document's own cover

An EPUB cover image, or the first page of a PDF, becomes the cover of both outputs — or Book Fork generates one.

PDF is recovered, not just extracted.

Naive PDF extraction returns one undifferentiated blob per page. Book Fork rebuilds from text lines: it splits glued runs like FIRSTThe, starts a paragraph where a line is indented, and treats a bold or clearly larger line as a heading. That recovers chapter structure — and a usable table of contents — even from converted ebooks whose text layer has collapsed.

  • Page size, bounding boxes and font size preserved
  • List markers detected
  • Printed contents pages are not mistaken for chapters
  • Images captured as assets

Books that print, in any script.

Both outputs embed real fonts, so a translated book is self-contained and prints correctly even on a machine with no system fonts installed. Vazirmatn covers Persian and Arabic-script targets; Crimson Text covers Latin, Greek and Cyrillic; other scripts fall back to matching Noto families.

For RTL targets the EPUB sets page-progression-direction="rtl", and lang and dir come from the target language configuration — not from a hardcoded list.

  • Print-ready PDF via PyMuPDF Story (pure Python)
  • Valid EPUB 3 with embedded fonts
  • RTL-aware page progression and direction
  • A4, A5, B5, Letter and A6 trim sizes

Honest limits

Only EPUB and PDF are accepted; the ingestion path sniffs content and rejects everything else, even though a seeded setting still lists txt and docx. Pages with no extractable text are flagged ocr_required rather than forced through OCR — no OCR provider ships today. Segment-level machine translation is not a substitute for human proofreading of literary or legal work.

Feed it a whole book.

Upload an EPUB or PDF and see the structure come back on the other side.