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

OCGs OFF after the default configuration's View usage rules (ISO 32000-1, 8.11.4.4).

Link copied to clipboard

OCGs ON after the default configuration's View usage rules (ISO 32000-1, 8.11.4.4).

Functions

Link copied to clipboard

True if the named OCG is visible per the default configuration. A group is on unless the configuration turns it off: the /Unchanged base state leaves every group on at load (ISO 32000-1, 8.11.4.3), and the renderer decides visibility by this same rule (#58).