PdfViewState

Scroll, zoom, search, and render-cache state for PdfView.

Properties

Link copied to clipboard

Zero-based index of the first visible page.

Link copied to clipboard

Horizontal scroll state used when a zoomed page is wider than the viewport.

Link copied to clipboard

Vertical lazy-list state backing the page list.

Link copied to clipboard

Search results ordered by page and match position.

Link copied to clipboard

Lifecycle state of the active document search.

Link copied to clipboard

Currently selected result, or null when the result list is empty.

Link copied to clipboard

Index of the selected result, or -1 when there is no result.

Link copied to clipboard
var zoom: Float

Current visual zoom multiplier, clamped to the configured range.

Functions

Link copied to clipboard
suspend fun animateScrollToPage(pageIndex: Int, scrollOffset: Int = 0)

Smoothly places pageIndex at the requested list offset.

Link copied to clipboard
suspend fun animateScrollToSearchResult(result: PdfViewSearchResult, alignment: PdfSearchScrollAlignment = PdfSearchScrollAlignment.Default)

Smoothly scrolls result to its position inside the PDF page.

Link copied to clipboard

Releases all cached page images without changing scroll or zoom.

Link copied to clipboard

Cancels the active search state and removes every highlight.

Link copied to clipboard
suspend fun scrollToPage(pageIndex: Int, scrollOffset: Int = 0)

Immediately places pageIndex at the requested list offset.

Link copied to clipboard
suspend fun scrollToSearchResult(result: PdfViewSearchResult, alignment: PdfSearchScrollAlignment = PdfSearchScrollAlignment.Default)

Immediately scrolls result to its position inside the PDF page.

Link copied to clipboard
suspend fun search(document: PdfDocument, query: String, options: PdfSearchOptions = PdfSearchOptions())

Searches every page in document.

Link copied to clipboard

Selects the next result, optionally wrapping to the first result.

Link copied to clipboard

Selects the previous result, optionally wrapping to the last result.

Link copied to clipboard

Selects and returns the result at index without scrolling.

Link copied to clipboard
fun updateZoom(zoom: Float)

Sets an absolute zoom value within the supported range.

Link copied to clipboard
fun zoomBy(factor: Float)

Multiplies the current zoom by a positive factor.