PageContext

data class PageContext(val pageNumber: Int, val totalPages: Int)

Context passed to a page's header / footer builder. Lets the builder vary the rendered content per physical page — typically to inject the current page number or the document's total page count.

Constructors

Link copied to clipboard
constructor(pageNumber: Int, totalPages: Int)

Properties

Link copied to clipboard

true on even page numbers — book layouts mirror margins and swap header content between even (verso) and odd (recto) pages.

Link copied to clipboard

true on the document's first physical page — different chrome for cover pages.

Link copied to clipboard

true on the document's last physical page.

Link copied to clipboard

true on odd page numbers. See isEven.

Link copied to clipboard

1-based page number currently being rendered.

Link copied to clipboard

total number of physical pages produced by the document. The renderer determines this with a dry-run pass before the real render so this value is always accurate, even when pages slice into multiple physical pages.