EpubDocument
A parsed EPUB, reflowed onto fixed-size pages and rendered through the shared KiteCanvas the PDF engine uses. The second document handler on :kitepdf-core.
Pipeline: ZipReader unzips the OCF container; HtmlParser builds a DOM per spine document; the CSS cascade (StyleResolver, via BoxBuilder) turns each into a LayoutBox tree; BoxLayout resolves the box model (margins, borders, padding, width, inline line breaking with justification) into document-space geometry; Paginator slices it into pages; and EpubPage paints backgrounds, borders, text and images. See EPUB_ROAD_TO_PERFECTION.md.
Properties
EPUB-specific metadata (title, authors, cover path, reading direction).
True for a pre-paginated (fixed-layout) book: one page per spine, no reflow.
Format-neutral title/authors/language for KiteDocument viewers.
Format-neutral outline for KiteDocument viewers: tableOfContents with each href resolved to a zero-based page index through the anchor/pagination map (null for grouping labels and unknown targets).
Page size, font size and margin. Change at runtime via withSettings.
Navigation tree from EPUB 3 nav.xhtml or EPUB 2 toc.ncx (empty if none).
Functions
Zero-based page of an internal href: path.xhtml or path.xhtml#id, zip-root-relative, exactly as EpubPage.links and TocEntry carry them. Null for unknown targets and external URLs; an unknown fragment falls back to its document's first page. This is the navigation half of a link tap: viewers scroll to the returned page.
Find needle across the book, lazily page by page (a UI can show incremental results). Same matching rules as KiteStructuredText.search: case-insensitive by default, line breaks read as one space, a hyphenated line break joins directly, matches never cross blocks.
Shorthand for withSettings changing only the body font size (points).
Shorthand for withSettings changing only the page margin (points).
Shorthand for withSettings changing the page size, e.g. on resize / rotation.