renderTo
Render this page into a KiteCanvas (typically the Compose binding's ComposeCanvas). deviceCtm is applied on top of user-space. Pass an identity matrix for a 1pt = 1pt rendering, or a scaled / Y-flipped matrix to fit a UI surface.
renderTo, drawing only the annotations annotations accepts. { false } renders the page content alone: for printing or exporting without markup, a clean thumbnail, or an editor that redraws its annotation layer on its own.
page.renderTo(canvas, ctm) { false } // no annotations
page.renderTo(canvas, ctm) { it.subtype != PdfAnnotation.Subtype.Highlight } // hide highlightsContent copied to clipboard
fun renderTo(canvas: KiteCanvas, deviceCtm: KiteMatrix, formState: PdfFormState?, annotations: (PdfAnnotation) -> Boolean = { true })
renderTo with the form being filled: a widget whose field has a value in formState is drawn from that value, and a field the state hides is not drawn. Pass null to render the file as it arrived.
val state = PdfFormState(doc)
state.setValue("name", "Ada")
page.renderTo(canvas, ctm, state) // the box shows Ada, whatever the file storesContent copied to clipboard