XpsDocument

An XPS or OpenXPS package opened as fixed pages in document-sequence order.

The package, sequence, documents and pages follow ECMA-388 §§9, 10. Both Microsoft's 2005 XPS namespace and OpenXPS use this handler. XPS coordinates are 1/96 inch; XpsPage exposes points (1/72 inch), as KitePage requires.

Paths, glyph runs, embedded TrueType/OpenType fonts, image brushes and resource dictionaries render through the same canvas as the other formats. Unsupported or damaged drawing elements are skipped independently, and a missing page stays in its original position as a placeholder. See this module's documentation for the rendering limits; this is not a validator.

val document = XpsDocument.open(bytes)
document.pages.first().renderTo(canvas)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
open val chapterCount: Int
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open override val metadata: KiteMetadata
Link copied to clipboard
Link copied to clipboard
open override val pageCount: Int
Link copied to clipboard
open override val pages: List<XpsPage>

Functions

Link copied to clipboard
open fun bookmarkOf(location: KiteLocation): KiteBookmark
Link copied to clipboard
open fun isChapterReady(chapter: Int): Boolean
Link copied to clipboard
open fun locate(bookmark: KiteBookmark): KiteLocation
Link copied to clipboard
open fun locationOf(pageIndex: Int): KiteLocation?
Link copied to clipboard
open fun page(location: KiteLocation): KitePage
Link copied to clipboard
open fun pageCountIn(chapter: Int): Int
Link copied to clipboard
open fun pageIndexOf(location: KiteLocation): Int?
Link copied to clipboard
open fun prepareChapter(chapter: Int)