Skip to main content

Module configuration

Module configuration 

Source
Expand description

Optional Content Group hierarchy and configurations.

Defined in ISO 32000-2 §8.11.4. Each PDF carries one default configuration (/OCProperties /D) and an optional array of alternate configurations (/OCProperties /Configs); a configuration says which layers are initially on/off, how they’re presented in a UI tree (/Order), how their visibility is grouped (/RBGroups), and which layers cannot be toggled by the user (/Locked).

This module turns each configuration dict into a typed Configuration and exposes the hierarchy as a LayerTree.

Structs§

AutoStateRule
One /AS automatic-state rule.
Configuration
One configuration of layer state and presentation.
LayerTree
A presentation hierarchy for layers, parsed from /Order.

Enums§

AutoStateEvent
/Event value on an /AS rule.
BaseState
/BaseState value.
LayerTreeNode
One node in the layer tree.
ListMode
/ListMode — layer-panel visibility scope.

Functions§

parse_auto_state
Parse /AS — an array of rule dicts.
parse_configuration
Parse a single configuration dict (the /D dict or one /Configs[i]).
parse_configurations
Walk /OCProperties and produce one Configuration for the default /D plus one for each entry in /Configs.
parse_order
Parse /Order according to ISO 32000-2 §8.11.4.3.
parse_rb_groups
Parse /RBGroups — an array of nested arrays, each containing OCG refs.