KitePage

interface KitePage

A renderable page from any document handler: the format-neutral fz_page equivalent. Both io.github.yuroyami.kitepdf.PdfPage and io.github.yuroyami.kitepdf.epub.EpubPage implement it, so one viewer / rasterizer path serves every format.

All coordinates are in points (1pt = 1/72in). displayToDeviceBase hides the per-format origin convention (PDF is y-up from bottom-left with page rotation; EPUB is y-down from top-left) behind a single mapping onto a top-left-origin, y-down device box [0, displayWidth] x [0, displayHeight].

Properties

Link copied to clipboard
abstract val displayHeight: Double

On-screen page height in points, after any page rotation.

Link copied to clipboard
abstract val displayWidth: Double

On-screen page width in points, after any page rotation.

Functions

Link copied to clipboard
abstract fun displayToDeviceBase(): Matrix

Maps unscaled display space onto a top-left-origin, y-down device box [0, displayWidth] x [0, displayHeight]. Compose output scaling on top:

Link copied to clipboard
abstract fun renderTo(canvas: KiteCanvas, deviceCtm: Matrix = Matrix.IDENTITY)

Paints the page into canvas under deviceCtm.

Link copied to clipboard

Structured text for extraction / search / selection, in display space (see KiteStructuredText for the coordinate convention), or null when the handler does not expose it. Both handlers implement this: EPUB pages natively, PDF pages by adapting their structured text.