Every recipe layout system I've seen starts the same way. A designer makes a beautiful two-page spread — photo left, recipe right — then someone tries it with a recipe that has 22 ingredients and 14 steps. The text overflows, and now you have that decision to make automatically, on every page, for a book with sixty of them.
That decision problem, not PDF rendering, is where print automation lives.
Fitting Is a Search Problem, Not a CSS Problem
The naive approach is to lay out the content and let it flow. For a bound book with facing pages that's exactly wrong: a recipe spilling three lines onto a second page wastes a full leaf and pushes every subsequent spread out of parity, so your left-hand photos end up on the right.
Treat each recipe instead as a fitting problem with a small set of levers, and search over them. Ours:






