link
Wraps the children added inside block in a hyperlink annotation pointing at url. The block contributes whatever visual content the user wants — text, an image, a styled card — and the renderer makes the bounding rectangle clickable in PDF viewers that support link annotations.
Use the text overload of this DSL on the inner block when styling a link as blue underlined text:
link("https://example.com") {
text("example.com") {
color = PdfColor.Blue
underline = true
}
}Content copied to clipboard
On Android, the underlying PdfDocument API does not support annotations, so the rectangle is recorded but clicks fall through. Visual styling on the inner content still conveys "this is a link".