PdfHyperlink

data class PdfHyperlink(val pageIndex: Int, val xPoints: Float, val yPoints: Float, val widthPoints: Float, val heightPoints: Float, val url: String)

One hyperlink annotation captured during rendering of a PDF page.

The library emits a PdfHyperlink for every call into com.conamobile.pdfkmp.render.PdfCanvas.linkAnnotation — i.e. every link(url) { … } block in the DSL or every text { hyperlink = … } — so consumers (most notably :pdfkmp-viewer) can re-attach a clickable affordance on top of the rasterised preview without re-parsing the encoded PDF for /Annot entries.

Coordinates are in PDF points (1 pt = 1/72 in) with a top-left origin and Y growing downward — same convention as com.conamobile.pdfkmp.render.PdfCanvas. Bounding box is (xPoints, yPoints, widthPoints, heightPoints).

Page numbering is zero-based and matches the order in which the driver produced pages, so it lines up with PdfTextRun.pageIndex.

Constructors

Link copied to clipboard
constructor(pageIndex: Int, xPoints: Float, yPoints: Float, widthPoints: Float, heightPoints: Float, url: String)

Properties

Link copied to clipboard

height of the clickable region.

Link copied to clipboard

zero-based page the link belongs to.

Link copied to clipboard
val url: String

destination URL passed to linkAnnotation.

Link copied to clipboard

width of the clickable region.

Link copied to clipboard

left edge of the clickable region.

Link copied to clipboard

top edge of the clickable region.