requestOpenFromDevice() to launch the picker, observe openDocumentState for the result, and call viewerState.open(selectedSource) when the user selects a file. The kpdf-compose module binds the platform effects automatically when you use rememberPdfViewerState, so no additional setup is needed.
Full pattern
The example below shows the complete flow: a button that triggers the picker and aLaunchedEffect that opens the document when the picker returns a selection.
KPdfOpenDocumentState variants
openDocumentState is a StateFlow<KPdfOpenDocumentState>. React to each variant to keep your UI consistent with the picker lifecycle.
If
openDocumentState appears stuck at Idle after tapping the button, the most common cause is that viewerState is being recreated on every recomposition. This happens when you construct KPdfViewerConfig inline, outside a remember block. Wrap the config in remember { KPdfViewerConfig.builder()…build() } to keep the state instance stable.