PdfLayout

sealed interface PdfLayout

How PdfView lays its pages out and how the user moves between them.

Inheritors

Types

Link copied to clipboard
object Companion
Link copied to clipboard
data class Continuous(val orientation: Orientation = Orientation.Vertical) : PdfLayout

All pages in one continuous scrollable strip (lazy: offscreen pages are neither composed nor rasterized). Pages fill the cross axis at their natural aspect ratio.

Link copied to clipboard
data class Paged(val orientation: Orientation = Orientation.Horizontal, val offscreenPages: Int = 1, val reverseLayout: Boolean = false) : PdfLayout

One page at a time with snap paging (swipe, or drive programmatically via PdfViewState). Each page is letterboxed to fit the viewport.

Link copied to clipboard
data class SinglePage(val pageIndex: Int) : PdfLayout

Exactly one fixed page, letterboxed to fit the viewport.

Link copied to clipboard
data class Spread(val orientation: Orientation = Orientation.Horizontal, val offscreenPages: Int = 1, val reverseLayout: Boolean = false) : PdfLayout

Two-page spreads: one snap-pager item shows pages (2k, 2k+1) side by side, like an open book; an odd trailing page centres alone. reverseLayout swaps both the swipe direction and the in-spread visual order (page 2k on the right), for right-to-left books. Navigation stays logical (nextPage() = index +1; the visible spread advances every second step). Meant for fixed-layout content (PDF, pre-paginated EPUB); reflowable EPUB gains nothing from it.