# Inkhaven 1.3.0 — Print production (PDF-1)

_The first minor-version milestone since the 1.2 line.  1.2.x built the
deep **middle** of the writing lifecycle — drafting and revising.  1.3
fills the **bookends**: getting a finished manuscript out the door, and
planning a book before the prose exists.  1.3.0 ships the first and
largest piece of that — a complete, self-contained **PDF production
subsystem** for taking a built book all the way to a print shop or a
hand-binding bench._

## The headline — PDF-1, end to end

A reading PDF comes off `inkhaven export pdf` in reading order. That is
the wrong order for a printer, missing a cover, and unchecked for the
problems that only surface in print. 1.3.0 closes every one of those gaps
over a **pure-Rust core** (`lopdf` + `barcoders`) — single binary, **no
external apps** — exposed identically across the CLI (`inkhaven pdf …`),
the `ink.pdf.*` Bund stdlib, and the `Ctrl+B O` book-take pipeline.

### Imposition (the marquee)

`inkhaven pdf impose` reorders a book into folding **signatures** for
hand-binding or a small print shop, and adds the printer marks a binder
needs:

- Binding styles: **perfect-bound**, **saddle-stitch**, **side-stab**.
- **Creep / shingling** — compensates for the inner sheets of a fold
  sticking out, using the paper caliper.
- **Printer marks** — crop, fold, registration, spine stair-step,
  signature number, optional colour bar.
- **Configurable through HJSON** — named profiles in the `imposition:`
  block (`default`, `chapbook` built in; add your own with any
  `sheets_per_signature`, sheet size, orientation, margins, creep, marks).
- `--dry-run` prints the plan (signatures / sheets / creep / first-sheet
  schematic) without writing; **`Ctrl+B Q`** (tree, *Q* for *quire*)
  previews it in the TUI; `imposed_pdf` in `output.extra_formats` imposes
  the just-built book on `Ctrl+B O`.

### Covers, spine, barcode

`inkhaven pdf cover --pages N` generates a one-page cover
`[ bleed | back | spine | front | bleed ]` with the **spine width computed**
from the page count + paper stocks (`cover:` config), optional front art,
back blurb, and a validated **EAN-13 ISBN barcode** (also standalone via
`pdf barcode`). `cover_pdf` is a `Ctrl+B O` book-take.

### Preflight

`inkhaven pdf preflight` catches the print-only problems. The flagship
check is **effective image DPI** — it follows each image through the
page's transformation matrix to find the size it is *actually printed at*,
so a screenshot blown up to fill the page is flagged regardless of what
its file says. Also: font embedding, page-size consistency, blank pages,
colour usage. Profiles (`hand_binding` / `print_shop` / `strict`) set the
DPI target (`preflight:` config).

### Page operations, metadata, outline

The structural toolkit over any PDF: `info`, `extract`, `delete`,
`rotate`, `reorder`, `split`, `merge`, `metadata` (read / set / strip),
`outline` (bookmarks, injected from the book hierarchy on assemble — an
additive, render-inert marker so hand-written `.typ` degrades cleanly).

### Finishing

`grayscale` (desaturates without re-rendering — neutralizes colour
operands + converts RGB/CMYK images to gray), `optimize` (lossless prune +
Flate-compress), `watermark` (translucent text / image stamp over a page
range), `sample` (an evenly-spaced quick-proof subset).

### Surfaces recap

- **CLI** — `inkhaven pdf info|extract|delete|rotate|reorder|split|merge|
  metadata|outline|impose|cover|barcode|preflight|grayscale|optimize|
  watermark|sample`.
- **Bund** — the matching `ink.pdf.*` words (handle-based; only
  `load`/`save` cross disk, gated by the `fs_read`/`fs_write` policy).
- **TUI** — `Ctrl+B Q` imposition preview; `imposed_pdf` / `cover_pdf`
  book-takes.
- **Config** — new `imposition:` / `cover:` / `preflight:` blocks +
  `output.imposed_pdf_config`, all through the project→global cascade.

One new tutorial — [65, Hand-binding](../Tutorials/65-hand-binding.md) —
walks the whole pipeline. Full design + formulas in
[RFC PDF-1](../PROPOSALS/PDF-1.md) and its
[implementation plan](../PROPOSALS/PDF-1_PLAN.md).

### Dependencies

The first runtime dependencies added in several cycles — a deliberate,
audited exception to the standing zero-new-deps stance: **`lopdf`** (pure-
Rust PDF) and **`barcoders`** (EAN-13). Both pure Rust, MIT/Apache, no
external applications; the fidelity of `lopdf` against real typst-pdf
output (fonts / images / vector) was the make-or-break risk and was
cleared with a corpus round-trip gate before anything was built on top.

Tests 1190 → 1270.

## The rest of the 1.3 line

1.3.0 ships pillar A's print track in full. The remaining 1.3.x roadmap:

- **Standard manuscript format** — a Shunn-style submission render target
  (double-spaced, running headers, `#` scene breaks).
- **Submission package** — RAG-grounded query-letter / synopsis /
  comp-title helpers + a lightweight submission tracker.
- **The Planning Board** (pillar B) — outline / beats / acts / scene cards
  tied to the Book→Chapter hierarchy + timeline + threads, integrating the
  Research book and helping fill the Facts book.

## Explicitly deferred

- **The Editorial Pass** (unify the detectors into one worklist) — a
  convenience/aggregation layer over tools that already exist and are
  individually runnable, not new capability. Revisit later as a thin
  pre-submission sweep, not a 1.3 headline.
- **The Whole-Book AI Editor** (RAG over the whole manuscript) → **1.4 or
  later**. The most ambitious AI play; pairs naturally with the
  submission-package helpers when it lands.

## Carried in from 1.2.23

- **M.1** — cap the crash-report action-ring `detail` length (the last
  open 1.2.15 stability item).
- The find & replace **modal live click-through** (engine + key wiring are
  unit/CLI-verified; only the on-screen interaction is unconfirmed).
- Low-priority stability items from the 1.2.23 audit: `backup`/`config`
  non-atomic sentinel saves, `backup::restore` per-entry atomicity.

## Older carryovers (still open)

- **1.2.20:** ePub inline images + popup footnotes.
- **1.2.19:** C.2.b (RU/DE quantity lexicons + `bootstrap-continuity`),
  C.3.b (embedding-based continuity comparison + TUI bible view),
  anachronism overlay.
- **1.2.18:** audiobook polish (parallel synth, cover art, `--bitrate`);
  perf follow-ups (DuckDB write batching, in-process bench scenarios).
- **Facts follow-ups (1.2.21):** internal-consistency check, series-shared
  facts, link-type annotations, embedding-based extract dedup.
- Sixth supported language; GitHub Release backfill for 1.2.11–1.2.19.
