PdfPage
A single PDF page. Obtained from PdfDocument.pages; not constructed directly.
val page = doc.pages[0]
println("${page.width} x ${page.height} pt, rotation ${page.rotation}°")
println(page.extractText())
for (link in page.annotations) { /* … */}
// Paint into any backend implementing PdfCanvas (see :kitepdf-compose etc.):
page.renderTo(canvas, deviceCtm = Matrix.IDENTITY)Properties
Annotations attached to this page (links, highlights, etc.). Parsed from the page's /Annots array; empty when the page has none.
Decoded content-stream bytes (FlateDecode etc. applied). May be empty. If /Contents is an array, the chunks are concatenated with a separating newline (per ISO 32000-1 §7.8.2: "The effect is as if all of the streams in the array were concatenated").
The page's own indirect reference (its entry in the parent's /Kids). null only for the unusual case of a page dict inlined directly in /Kids. The writer needs this to target the page object for edits.
Structured text — spans clustered into lines, lines clustered into blocks. Use this when you need geometry (selection rectangles, search highlights) alongside the text. For a plain string, prefer extractText.
Multiplier for user-space units on this page (PDF 1.6+, §14.8.1). Default 1.0 — each unit is 1/72 inch. A /UserUnit of 2.0 means each unit is 2/72 inch, doubling the effective page size for the same coordinate stream. Useful for very large pages (architectural drawings, posters).