PdfOptionalContent

data class PdfOptionalContent(val groups: List<PdfOptionalContent.OptionalContentGroup>, val onByDefault: Set<String>, val offByDefault: Set<String>, val defaultConfigName: String?)

Optional Content metadata — ISO 32000-1 §8.11. Optional Content Groups (OCGs) are the PDF spec's name for "layers": chunks of content that can be selectively shown or hidden via /OC marked-content sections and Form XObjects with /OC entries.

KitePDF v0.0.x exposes the OCG topology and default visibility state (read-only). The renderer doesn't yet honour /OC visibility — that's a future round. Until then this view lets you build a layer-toggle UI even if the underlying renderer still draws everything.

Constructors

Link copied to clipboard
constructor(groups: List<PdfOptionalContent.OptionalContentGroup>, onByDefault: Set<String>, offByDefault: Set<String>, defaultConfigName: String?)

Types

Link copied to clipboard
object Companion
Link copied to clipboard
data class OptionalContentGroup(val id: String, val name: String, val intent: List<String>, val usage: PdfDictionary?)

One Optional Content Group. The id is the OCG's PDF object number stringified — stable inside the document and what /OC marked-content sections refer to.

Properties

Link copied to clipboard

Display name of the default config (/D /Name), if present.

Link copied to clipboard

All OCGs declared in /OCProperties /OCGs.

Link copied to clipboard

Identifiers of OCGs that are explicitly OFF in the default configuration.

Link copied to clipboard

Identifiers of OCGs that are ON in the default configuration.

Functions

Link copied to clipboard

True if the named OCG is visible per the default configuration.