EpubView

fun EpubView(document: EpubDocument, modifier: Modifier = Modifier, page: Int? = null, background: Color = Color.White, theme: ReaderTheme? = null, pageSpacing: Dp = 8.dp, onPageRendered: (pageIndex: Int, image: ImageBitmap) -> Unit? = null, onTap: (Offset) -> Unit? = null, onLinkTap: (PdfAction) -> Boolean? = null)

Convenience viewer for a reflowed EpubDocument: opens the whole book as a continuous vertical scroll, or a single page. Delegates to the shared PdfView renderer. Pages are rasterized once per (page, size) bucket and drawn as images, exactly like PDF.

val doc = EpubDocument.open(bytes) ?: return
EpubView(doc, Modifier.fillMaxSize())

For full control (paged/horizontal layouts, zoom bounds, overlays, custom colours) build the state yourself and use the PdfView state overload:

val state = rememberEpubViewState(doc)
PdfView(state, layout = PdfLayout.Paged(Orientation.Horizontal))

Parameters

page

index of the single page to show, or null (default) for the whole book as a continuous vertical scroll.

background

colour painted behind page content. Ignored when theme is set (the theme owns the paper colour).

theme

optional reading theme: ReaderTheme.Dark for night mode, ReaderTheme.Sepia, or ReaderTheme.Light/null for the author's colours. Applied at render, so switching is instant (no re-layout).