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.

This view exposes the OCG topology and default visibility state (read-only). The renderer honours /OC visibility: marked-content sections and XObjects whose OCG is hidden in the default configuration are skipped while drawing.

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. It is stable inside the document, and /OC marked-content sections refer to it.

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.