bookmark

fun bookmark(title: String, level: Int = 0)

Adds an entry to the document outline — the bookmark sidebar PDF readers show for quick navigation. The entry points at this marker's position in the rendered flow, so place it right before the heading it labels.

Zero-size: contributes nothing visual. Supported on iOS and JVM/Desktop; Android's PdfDocument API has no outline support, so the marker is silently ignored there.

Parameters

title

text shown in the outline panel.

level

nesting depth — 0 for chapters, 1 for sections under the previous level-0 entry, and so on.