KPDF deliberately does not own the share UI. Instead,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.
exportPdf() returns the current PDF as a Result<ByteArray>. You take those bytes and pass them to your own Android Intent or iOS UIActivityViewController. This keeps platform share behaviour fully under your control.
Coroutine-based share example
exportPdf() is a suspending function, so launch it from a CoroutineScope. Use fold to handle success and failure in one expression:
Using onSuccess / onFailure separately
If you prefer to handle each branch independently, useonSuccess and onFailure:
Full integration example
The snippet below shows the share flow wired into aKPdfViewerToolbar, matching the full-screen example from the Display a PDF guide:
KPDF intentionally does not show a share sheet or system dialog. After
exportPdf() resolves, your app is responsible for passing the ByteArray to the appropriate platform API — Intent.ACTION_SEND on Android or UIActivityViewController on iOS. This gives you full control over the share target, the MIME type, and any additional metadata.