Package-level declarations
Types
KiteCanvas backed by a Compose Multiplatform DrawScope.
Bitmaps for the Compose canvas. decodeRaw wraps pixels that KitePDF's core decoded with ImageKodec. decode reads an encoded file with the decoder the host platform provides: Skia on the JVM, iOS, macOS and the web, and BitmapFactory on Android. KitePDF does not call decode for page images: an image that the shared decoders refuse draws as a placeholder on every canvas (#184).
Wraps the page's canvas to filter ink, inspect glyphs or insert drawing calls during the page paint pass. Return a KiteCanvas delegating unchanged calls to the supplied canvas. It already includes the optional reader theme, so custom colours pass through that theme too; paper and viewer overlays remain outside the decorator.
The messages of a PDF choice control (ISO 32000-1, 12.7.4.4). Provide translated words with LocalKiteChoiceStrings; option labels themselves come from the document's /Opt entries.
How KiteDocView lays its pages out and how the user moves between them.
Colours used by KiteDocView.
Observable state + control surface of a KiteDocView.
What KiteDocView does with a link to an address outside the document, such as a web page or a mail address, when onLinkTap does not take it (#519).
One entry of KiteDocViewState.highlights: where to paint (hit) plus how to paint it.
A link that the reader tapped, handed to KiteDocView's onLinkTap before the viewer acts on it. Every format gives the same facts, so most hosts need no when:
Which page margin an edge marker is painted in.
How a KiteDocLayout.Paged pager or a KiteDocLayout.Continuous strip fits each page into the viewport.
The page under a viewport point, and a point on that page.
What the pageOverlay of KiteDocView draws in: one page, in the page's own frame. The frame moves and scales with the page, so an element placed on a rectangle of the page stays on that rectangle at any zoom, and grows with the page (#30).
Imperative page → ImageBitmap pipeline. This is the raster engine behind KiteDocView; it is public so apps with custom viewers (own pagers, thumbnail grids, PNG export jobs) don't have to re-implement the CTM/flip/hairline math themselves.
Where the viewer's raster of one page stands, as KiteDocViewState.pageRenderState reports it. A page that failed keeps the last bitmap it had, and KiteDocViewState.retryPage renders it again.
How KiteDocView turns pages into pixels. Pick a variant; each carries only the knobs that actually apply to it, so there are no settings that silently do nothing. Defaults to Rasterized via KiteRenderSpec.Default.
A continuous viewport anchor that a host can persist between reading sessions. location names the leading visible page, and offsetPx counts unzoomed layout pixels scrolled beyond that page's leading edge along the scroll axis. It works for vertical and horizontal continuous layouts, including right-to-left layout direction. It does not save zoom or cross-axis pan.
Which end of the selection a handle marks, in reading order.
Draws one selection boundary marker ("thumb") for KiteDocView.
Default look of KiteSelectionMenu's built-in chrome.
One action in a KiteSelectionMenu: a label, an optional leading icon slot, and what to do with the selected text.
A finalized or in-progress text selection on one page (cross-page selection is out of scope). start/end are INCLUSIVE flattened char indices into the page's io.github.yuroyami.kitepdf.core.KiteStructuredText reading order; text is the range as a reader copies it (io.github.yuroyami.kitepdf.core.KiteStructuredText.copyText): \n\n between blocks, and a wrapped paragraph of a book as one line; quads are display-space, one per line touched.
The words that KiteDocView and its widgets give a screen reader. The defaults are English; provide a translated set through LocalKiteViewerStrings:
Zoom & pan behaviour for KiteDocView.
Properties
The words of PDF choice controls below this composition.
The KiteViewerStrings of the viewer and the widgets below it.
Functions
Encode this ImageBitmap to PNG bytes. Write the result to a file, share it or upload it. PNG is lossless, so the bytes keep every pixel of the bitmap.
Convenience entry point: remembers its own state internally. Takes any KiteDocument, so a PdfDocument and an io.github.yuroyami.kitepdf.epub.EpubDocument both go here.
THE KitePDF viewer composable. It draws a KiteDocument, so a PDF and an EPUB go through the same code path, the same gestures and the same widgets.
Previous / "x of y" / next pill. The buttons turn off at the ends, and on a fixed page (KiteDocLayout.SinglePage), which navigation does not turn.
A navigation panel over the document's outline (PDF bookmarks / EPUB table of contents): an indented, clickable column of KiteOutlineItems. Clicking an entry scrolls to its target (and calls onNavigate); on a book still paginating this lays out that one chapter rather than the whole book; entries without one (unresolvable destinations, grouping labels) render dimmed and unclickable. Plain foundation styling, like every widget here.
"current / total" page readout. Recomposes as the user scrolls or swipes.
The selection context menu: place it in KiteDocView's overlay slot and it appears whenever text is selected, listing items and, when highlightColors is non-empty, a wrapping row of colour swatches.
Horizontal strip of tappable page thumbnails; the current page is outlined. Tapping a thumbnail animates the KiteDocView sharing this state to that page.
Remembers a state reopened at a page and continuous scroll offset.
Remembers a KiteDocViewState opened at bookmark, a position saved from an earlier reading session.
Remembers a KiteDocViewState for document. Hoist it to drive a KiteDocView from anywhere: navigation buttons in your top bar, a zoom slider, a HUD overlay. The state object is the single point of control.
KitePageRasterizer wired to the composition's density, layout direction and font resolver.
rememberKitePageRasterizer with an explicit per-bitmap allocation ceiling.