API reference / Common / FitMode
Type Alias: FitMode
type FitMode = "none" | "width" | "height" | "both" | "either";How the camera derives its zoom from the viewport and the current spread — the set of pages shown together as a unit (one page in a single-page layout; a facing pair in a double-page one).
A fit is sticky: the view re-derives the zoom whenever the viewport, density, padding, or page set changes, so it survives a resize. While a fit is active the camera ignores explicit zoom_to requests — the fit governs the zoom; the host reads the derived value back with zoom.
Each variant fits the spread, not the whole document plane: a vertically-scrolling stack has no bounded height to fit, so Height / Both / Either measure the spread's box. How the spread is chosen is the scroll mode's own call — spread mode fits the shown spread, while continuous fits the largest loaded spread so the zoom is stable as you scroll a mixed-size document.