Package-level declarations

Types

Link copied to clipboard
class ComposeCanvas(drawScope: DrawScope, textMeasurer: TextMeasurer, hairlineWidthPx: Float = 1.0f)

PdfCanvas backed by a Compose Multiplatform DrawScope.

Link copied to clipboard
actual object ImageDecoder
expect object ImageDecoder

Platform-supplied image decoder. KitePDF's core stays pure-Kotlin-stdlib; actual JPEG / PNG / etc. decoding rides on whatever the host platform already provides — Skia on Desktop, the OS framework on Android / iOS, createImageBitmap on JS.

actual object ImageDecoder
actual object ImageDecoder
actual object ImageDecoder
actual object ImageDecoder
actual object ImageDecoder
Link copied to clipboard
sealed interface PdfLayout

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

Link copied to clipboard
class PdfRasterizer(density: Density, layoutDirection: LayoutDirection, textMeasurer: TextMeasurer)

Imperative page → ImageBitmap pipeline. This is the raster engine behind PdfView; it is public so apps with custom viewers (own pagers, thumbnail grids, PNG export jobs) don't have to re-implement the CTM/flip/hairline math themselves.

Link copied to clipboard
sealed interface PdfRenderSpec

How PdfView turns pages into pixels. Pick a variant; each carries only the knobs that actually apply to it, so there are no settings that silently do nothing. Defaults to Rasterized via PdfRenderSpec.Default.

Link copied to clipboard
data class PdfViewColors(val pageBackground: Color = Color.White, val viewportBackground: Color = Color.Transparent)

Colours used by PdfView.

Link copied to clipboard
class PdfViewState(val document: <Error class: unknown class>, initialPage: Int = 0)

Observable state + control surface of a PdfView.

Link copied to clipboard
data class PdfZoomSpec(val pinchEnabled: Boolean = true, val doubleTapEnabled: Boolean = true, val panEnabled: Boolean = true, val minZoom: Float = 1.0f, val maxZoom: Float = 8.0f, val doubleTapZoom: Float = 2.5f, val resetZoomOnPageChange: Boolean = true)

Zoom & pan behaviour for PdfView.

Functions

Link copied to clipboard

Encode this ImageBitmap to PNG bytes — the "saveable image" counterpart of PdfView's onPageRendered callback. Write the result to a file, share it, upload it; PNG is lossless so the export is pixel-identical to what was on screen.

Link copied to clipboard
fun PdfNavigationControls(state: PdfViewState, modifier: Modifier = Modifier, contentColor: Color = Color.White, containerColor: Color = Color(0xB3222222), textStyle: TextStyle = TextStyle.Default)

Previous / "x of y" / next pill. Buttons auto-disable at the ends.

Link copied to clipboard
fun PdfPageIndicator(state: PdfViewState, modifier: Modifier = Modifier, textStyle: TextStyle = TextStyle.Default, format: (currentPage: Int, pageCount: Int) -> String = { c, t -> "${c + 1} / $t" })

"current / total" page readout. Recomposes as the user scrolls or swipes.

Link copied to clipboard
fun PdfThumbnailStrip(state: PdfViewState, modifier: Modifier = Modifier, thumbnailHeight: Dp = 72.dp, spacing: Dp = 8.dp, contentPadding: PaddingValues = PaddingValues(8.dp), selectedBorderColor: Color = Color(0xFF4A90D9), pageBackground: Color = Color.White)

Horizontal strip of tappable page thumbnails; the current page is outlined. Tapping a thumbnail animates the PdfView sharing this state to that page.

Link copied to clipboard
fun PdfView(document: <Error class: unknown class>, modifier: Modifier = Modifier, page: Int? = null, background: Color = Color.White, pageSpacing: Dp = 8.dp, onPageRendered: (pageIndex: Int, image: ImageBitmap) -> Unit? = null)

Convenience entry point: remembers its own state internally.

fun PdfView(state: PdfViewState, modifier: Modifier = Modifier, layout: PdfLayout = PdfLayout.Default, zoomSpec: PdfZoomSpec = PdfZoomSpec(), renderSpec: PdfRenderSpec = PdfRenderSpec.Default, colors: PdfViewColors = PdfViewColors(), pageSpacing: Dp = 8.dp, userScrollEnabled: Boolean = true, onPageRendered: (pageIndex: Int, image: ImageBitmap) -> Unit? = null, pagePlaceholder: @Composable (pageIndex: Int) -> Unit? = null, overlay: @Composable BoxScope.(PdfViewState) -> Unit? = null)

THE KitePDF viewer composable.

Link copied to clipboard

PdfRasterizer wired to the composition's density, layout direction and font resolver.

Link copied to clipboard
fun rememberPdfViewState(document: <Error class: unknown class>, initialPage: Int = 0): PdfViewState

Remembers a PdfViewState for document. Hoist it to drive a PdfView from anywhere — navigation buttons in your top bar, a zoom slider, a HUD overlay — the state object is the single point of control.