Package-level declarations
Types
Grow-on-demand byte buffer. Pure Kotlin (no platform OutputStream classes), so it works in commonMain across all targets, and it's faster than mutableListOf<Byte>() because it stores into a contiguous primitive array.
Random-access byte cursor over an in-memory PDF.
A reading position that survives a re-flow. Save this when the reader leaves, hand it back when they return, and they land where they were even if the font size, page size or margins changed in between.
Bytes that a reader can fetch at any offset, such as a file on disk.
A signal that a render in progress may stop early, as MuPDF's abort cookie does. A renderer checks it between operators. Once it reads true, the render paints nothing more and returns promptly, with the canvas closed (#188).
The content of a data: URL (RFC 2397): its media type and its bytes. A document carries a small resource inside itself this way, an image or a font as Base64, or an SVG percent-encoded:
A parsed document from any handler: the fz_document equivalent. Lets a viewer treat a io.github.yuroyami.kitepdf.PdfDocument and an io.github.yuroyami.kitepdf.epub.EpubDocument uniformly.
Common supertype for "these bytes are not a well-formed document of the format this handler reads" failures. Format handlers throw a subtype (PdfFormatException, EpubFormatException, ...) with a precise message; callers that prefer null-on-failure use the handler's openOrNull.
How a KiteTextLine ends, which decides how KiteStructuredText.copyText joins it to the next line of its block.
A link on a page: the area that a tap follows, and where the link leads (#433).
What a link is for. A viewer can open a reference in place, such as a note in a popup, instead of moving the reader away from the page.
Where a page sits in the CURRENT layout: chapter, then page inside it.
One node of a format-neutral outline (PDF bookmarks / EPUB table of contents), for a viewer's navigation panel.
Marks the raw object-model surface: direct access to xref tables, trailer dictionaries, indirect-object resolution, and the low-level editor primitives. The FILE FORMAT these expose is stable; the Kotlin surface is not, and may change between minor releases without a deprecation cycle. High-level API (pages, outlines, form fields, rendering, search) never requires this opt-in.
One stop in a page's reading order: what a screen reader would announce, in the order it would announce it. KitePage.readingOrder gives the items of a page of any format.
PDF rectangle: left, bottom, right, top in user-space units.
Format-neutral structured text for a KitePage: the minimal blocks → lines → text model a viewer needs for extraction, search highlights and selection, without committing to a handler's internals.
A paragraph-ish group of consecutive lines from one layout block.
One laid-out line. charEdges has text.length + 1 display-space boundaries: charEdges[i] is where char i starts, the final entry where the line ends. That is enough to build sub-line highlight quads. Entries follow the text's logical order, so right-to-left runs may have descending edges and positioned runs may change direction. Hit tests use each adjacent pair's extent; highlights enclose every selected pair.
The fz_warn equivalent: a process-global, nullable warning sink for the places where the engine silently salvages (cached-null resolves, repair fallbacks, skipped page-tree kids, failed filters, placeholder images).
Receives one-line diagnostics from lenient salvage paths.
Raised when a document is encrypted and the supplied password did not authenticate. PDF standard security raises it today; the type is format-neutral so a future DRM-aware handler can raise the same one.
Raised for any structural PDF error: bad header, truncated stream, malformed xref, etc.
Functions
A stable identifier for the calling thread (0 on single-threaded targets). Lets cycle guards distinguish same-thread reentrancy (a real cycle) from another thread legitimately resolving the same object concurrently.
Emit through KiteWarnings.sink. Message construction is lazy (free when no sink is installed) and a throwing sink can never break the caller.