> ## Documentation Index
> Fetch the complete documentation index at: https://mahmoud-b28887f9.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# KPDF: PDF viewer SDK for Kotlin Multiplatform apps

> Add a production-ready PDF viewer to your Android and iOS Compose app in minutes. Load from URLs, Base64, or bytes with caching, zoom, and save built in.

KPDF is a Kotlin Multiplatform PDF library that gives your Android and iOS Compose Multiplatform apps a full-featured PDF viewer. Add it with two Gradle dependencies and you get URL loading, intelligent page caching, pinch-to-zoom, swipe navigation, save/export flows, device file picking, and connected toolbar and thumbnail views — all driven by a single `KPdfViewerState`.

<CardGroup cols={2}>
  <Card title="Quick Start" icon="rocket" href="/quickstart">
    Display your first PDF in under five minutes with a minimal working example.
  </Card>

  <Card title="Installation" icon="download" href="/installation">
    Add the Gradle dependencies and configure your project for Android and iOS.
  </Card>

  <Card title="PDF Sources" icon="file-pdf" href="/concepts/pdf-sources">
    Load PDFs from remote URLs, raw bytes, or Base64-encoded strings.
  </Card>

  <Card title="API Reference" icon="code" href="/api/kpdf-viewer-state">
    Browse the full public API: viewer state, config, sources, and state types.
  </Card>
</CardGroup>

## How KPDF works

KPDF is split into two modules that work together:

* **`kpdf-core`** — The shared PDF engine: source loading, page rendering, RAM and disk caching, navigation, zoom, save/export, and device file picker state.
* **`kpdf-compose`** — Compose Multiplatform UI components and platform integrations for save and open flows.

<Steps>
  <Step title="Add the dependencies">
    Add `kpdf-core` and `kpdf-compose` to your Gradle build file.
  </Step>

  <Step title="Create a PDF source">
    Choose `KPdfSource.Url`, `KPdfSource.Bytes`, or `KPdfSource.Base64` based on where your PDF comes from.
  </Step>

  <Step title="Create viewer state">
    Call `rememberPdfViewerState(source, config)` inside your composable to get a `KPdfViewerState`.
  </Step>

  <Step title="Render the viewer">
    Pass the state to `KPdfViewer(state = viewerState)` and optionally add `KPdfViewerToolbar` and `KPdfThumbnailStrip`.
  </Step>
</Steps>

## Key features

<CardGroup cols={2}>
  <Card title="Multi-source loading" icon="link" href="/concepts/pdf-sources">
    Load PDFs from HTTPS URLs with custom headers, raw byte arrays, or Base64 strings — including data URL format.
  </Card>

  <Card title="Smart caching" icon="database" href="/concepts/viewer-config">
    Configurable RAM and disk page caches keep scrolling smooth and allow offline reopening of remote documents.
  </Card>

  <Card title="Save & export" icon="floppy-disk" href="/guides/save-export">
    Built-in save flow launches the platform file picker. Export raw bytes for custom share flows.
  </Card>

  <Card title="Connected views" icon="layout" href="/components/toolbar">
    Toolbar and thumbnail strip components share the same viewer state — no manual wiring required.
  </Card>
</CardGroup>
