PdfViewState
Observable state + control surface of a PdfView.
Everything a navigation/zoom widget needs lives here, so widgets are just composables that take a PdfViewState. Place them inside the viewport (via PdfView's overlay slot), next to it, or anywhere else in your tree.
Reads (currentPage, zoom, panOffset…) are snapshot-state backed and recompose their readers automatically. Navigation suspends until finished; calls made before the state is attached to a composed PdfView are remembered and applied on attach.
Properties
The page the viewport currently rests on: the snapped page in paged mode, the page nearest the viewport centre in continuous mode.
App-owned highlights, each with its own fill colour and its own optional margin marker. Painted over the page after searchHighlights, in list order, so later entries win where they overlap. Clear by assigning an empty list.
True while text selection owns the pointer, and while the selection it produced is still on screen.
Fires on every selection change, including clearing (null).
Search hits to paint as translucent quads over their pages (colour: PdfViewColors.searchHighlight). Feed it from PdfDocument.search / KiteStructuredText.search (quads are display-space, as both produce); clear it by assigning an empty list.
The active text selection, or null. Set by the long-press-drag gesture; observe via snapshot reads or onSelectionChange. The viewer never touches the clipboard itself. Read TextSelection.text and copy in the app (see the sample's selection actions).
True only while the finger is still down on the long-press drag that is building the selection; false the moment it lifts.
Current zoom factor. 1 = fit. Bounded by PdfZoomSpec.minZoom/maxZoom.
Functions
Animates to page (coerced into range).
Jumps to page (coerced into range) without animation.