# Scan-to-EPUB fixture

This directory contains the reproducible fixture used by the BookTranslator
article "How to Convert a Scanned Book to a Reflowable EPUB."

The four-page booklet, its text, generator, and generated artifacts are
dedicated to the public domain under CC0 1.0. It is a controlled teaching
fixture, not a historical scan and not evidence about every OCR engine.

The committed bytes were generated on macOS with:

- Python 3.12.14;
- Pillow 12.3.0;
- Tesseract 5.5.3 with the `eng` traineddata package; and
- `/System/Library/Fonts/Supplemental/Georgia.ttf` (the hash is recorded in
  `fixture-manifest.json`).

Run it with those dependencies available:

```bash
python build_fixture.py
```

On another operating system, set `BOOK_FIXTURE_FONT` to a readable TrueType
font before running. A different font, Pillow build, Tesseract build, or
traineddata file can change line wrapping, OCR output, and artifact hashes.
The script stops with a specific preflight error when the font, Tesseract
executable, or English traineddata is missing.

The script renders four slightly rotated grayscale page images, runs Tesseract
with the fixed `eng`, OEM 1, PSM 6, and 300 dpi settings, saves the raw OCR,
records page-furniture cleanup decisions, and packages the corrected source
text as a deterministic EPUB. The EPUB is validated separately so the exact
EPUBCheck version and raw output remain visible.
