PdfAnnotation

data class PdfAnnotation(val subtype: PdfAnnotation.Subtype, val rect: Rectangle, val contents: String, val color: RgbColor?, val uri: String?, val action: PdfAction?, val rawDestination: PdfObject?, val appearanceStream: PdfStream?, val raw: PdfDictionary)

One PDF annotation (ISO 32000-1 §12.5).

The subtype discriminates between the 20+ annotation types defined in the spec. First-class support is provided for:

Other subtypes are parsed into Subtype.Other and exposed in raw so callers can pattern-match. The rectangle and contents are always there.

For rendering, appearanceStream (the /AP /N stream when present) is the canonical way to draw the annotation — it's a Form XObject the spec mandates "shall be used as the visual representation." We expose it as a raw stream so PageRenderer can recursively render it.

Constructors

Link copied to clipboard
constructor(subtype: PdfAnnotation.Subtype, rect: Rectangle, contents: String, color: RgbColor?, uri: String?, action: PdfAction?, rawDestination: PdfObject?, appearanceStream: PdfStream?, raw: PdfDictionary)

Types

Link copied to clipboard
object Companion
Link copied to clipboard

Properties

Link copied to clipboard

Parsed /A action (typed). null when the annotation has no action dict.

Link copied to clipboard

/AP /N appearance Form XObject, or null.

Link copied to clipboard

Border / highlight / underline colour, or null when /C is omitted.

Link copied to clipboard
Link copied to clipboard

The raw dict — for callers that need fields we didn't extract.

Link copied to clipboard

Raw /Dest value on link annotations — pass through PdfDocument.resolveDestination.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val uri: String?

Link annotation: URL for /A /URI actions; null otherwise.