Skip to main content

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.

KPDF installs as two Gradle dependencies. Declare both in your shared module’s build file, sync, and you are ready to use the SDK.

Current version

The current stable release is 1.0.0.

Add the dependencies

Add both modules to your shared Kotlin Multiplatform module’s dependencies block:
You typically need both kpdf-core and kpdf-compose together. kpdf-core is the engine — it provides PDF loading, rendering, caching, and state APIs. kpdf-compose is the UI layer — it provides KPdfViewer, KPdfViewerToolbar, KPdfThumbnailStrip, and rememberPdfViewerState, plus the platform save/open flow bindings for Android and iOS. Without kpdf-compose, you have no Compose viewer components.
dependencies {
    implementation("com.mahmoud.kpdf:kpdf-core:1.0.0")
    implementation("com.mahmoud.kpdf:kpdf-compose:1.0.0")
}
If your project uses a version catalog, add the entries to libs.versions.toml first:
[versions]
kpdf = "1.0.0"

[libraries]
kpdf-core = { module = "com.mahmoud.kpdf:kpdf-core", version.ref = "kpdf" }
kpdf-compose = { module = "com.mahmoud.kpdf:kpdf-compose", version.ref = "kpdf" }
Then reference them in your build file:
dependencies {
    implementation(libs.kpdf.core)
    implementation(libs.kpdf.compose)
}

What each module provides

ModuleWhat it gives you
kpdf-coreKPdfSource, KPdfViewerConfig, KPdfViewerState, KPdfFactory, rendering, caching, navigation, zoom, save/export, and open state APIs
kpdf-composeKPdfViewer, KPdfViewerToolbar, KPdfThumbnailStrip, rememberPdfViewerState, and platform save/open flow bindings for Android and iOS

Verify the setup

After syncing, import a KPDF type in your shared code to confirm the dependency resolved:
import com.mahmoud.kpdf_core.api.KPdfSource
import com.mahmoud.kpdf_compose.rememberPdfViewerState
If either import fails, check that Gradle sync completed without errors and that your repository configuration includes Maven Central or the GitHub Packages repository where KPDF is published.

Next step

With the dependencies in place, follow the Quickstart to display your first PDF in a Compose composable.