Documentation Index
Fetch the complete documentation index at: https://mahmoud-b28887f9.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
KPdfFactory is the entry point to the KPDF SDK outside of Compose. It exposes a single static method, create(), that returns a KPdf facade. From the facade you call viewerState() to produce a KPdfViewerState — the same interface used internally by rememberPdfViewerState. Use this path when you need to manage viewer state in a ViewModel, a non-Compose screen, or any other context where Compose lifecycle hooks are not available.
If you are building a Compose Multiplatform UI, prefer
rememberPdfViewerState from the kpdf-compose module. It wires up the platform save, open, and external-app effects automatically and ties the viewer state lifetime to the composition. Use KPdfFactory only when you have a concrete reason to manage the lifecycle yourself.KPdfFactory.create
Returns a platform-specific implementation of theKPdf facade. KPdfFactory is an expect object, so the actual implementation is resolved per platform at compile time.
KPdf.viewerState
Creates aKPdfViewerState for the given source and configuration. You own the state’s lifetime — call close() when the viewer is no longer needed to release cached pages and coroutine work.
The PDF source to load. See
KPdfSource for the available variants.The viewer configuration. Defaults to a config with all options at their default values. See
KPdfViewerConfig for the full list of options.KPdfViewerState.