Package-level declarations

Types

Link copied to clipboard

A fully-rendered PDF document, ready to be persisted or transferred.

Link copied to clipboard
object PdfKmp

Library version. The string is generated at build time from the VERSION_NAME Gradle property in the root gradle.properties, so a release bump cannot drift from what consumers see at runtime.

Link copied to clipboard
object PdfLog

Diagnostics hook for conditions PdfKmp handles gracefully but silently — undecodable image bytes, missing fonts falling back to the default, and similar "the document still renders, but not the way you meant" cases.

Functions

Link copied to clipboard

Returns the Android implementation of PdfDriverFactory, backed by android.graphics.pdf.PdfDocument.

Returns the platform's default PdfDriverFactory.

Returns the iOS implementation of PdfDriverFactory, backed by UIGraphicsBeginPDFContextToData and Core Graphics.

Returns the JVM / Desktop implementation of PdfDriverFactory, backed by Apache PdfBox.

Web (Kotlin/Wasm) default backend.

Link copied to clipboard
fun <Error class: unknown class>.openInNewTab(): Boolean

Opens this document in a new browser tab using the browser's own PDF viewer (PDFium in Chrome/Edge, PDF.js inside Firefox, Apple's viewer in Safari) — zoom, search, print, and download come for free, which is why PdfKmp ships no embedded viewer for the web target.

Link copied to clipboard
fun pdf(factory: PdfDriverFactory = defaultPdfDriverFactory(), block: DocumentScope.() -> Unit): PdfDocument

Top-level entry point of the PdfKmp DSL. Builds a PDF document and returns it ready for PdfDocument.save or PdfDocument.toByteArray.

Link copied to clipboard
suspend fun pdfAsync(factory: PdfDriverFactory = defaultPdfDriverFactory(), block: DocumentScope.() -> Unit): PdfDocument

Suspend variant of pdf that runs a preflight pass before rendering, resolving every com.conamobile.pdfkmp.node.LazyNode in the document tree. Use this when the DSL contains nodes whose payload is fetched through a suspend API — the typed Res.drawable.X overloads in :pdfkmp-compose-resources are the canonical example.

Link copied to clipboard
fun <Error class: unknown class>.toNSData(): <Error class: unknown class>

Exposes the rendered PDF bytes as an NSData for friction-free Swift interop.