Expand description
Per-layer metadata (Optional Content Groups).
Defined in ISO 32000-2 §8.11.2 (the OCG dictionary itself) and
§8.11.4.4 (the /Usage sub-dict, which describes the contexts —
view, print, export — in which the layer is meaningful).
Phase 1 is document-wide enumeration: produce one Layer
record per OCG referenced from the catalog’s
/OCProperties /OCGs array. Visibility defaults come from the
default configuration’s /OFF array; locked state from /Locked.
Hierarchy (/Order) and alternate configurations live in Phase 2.
Structs§
- Creator
Info /CreatorInfosub-dict — authoring application + subtype hint.- Export
Usage /Exportsub-dict.- Language
Usage /Languagesub-dict.- Layer
- One Optional Content Group (PDF “layer”).
- Layer
Usage - Hints from the OCG
/Usagesub-dict. - Print
Usage /Printsub-dict.- User
Usage /Usersub-dict — user/group ownership.- View
Usage /Viewsub-dict.- Zoom
Usage /Zoomsub-dict — visibility range.
Enums§
- Layer
Intent /Intenton an OCG, declaring which audiences the layer is for.- Page
Element Subtype /PageElement /Subtypevalue — role of the layer on the page.- Usage
State - Usage state —
/ONor/OFF.
Functions§
- parse_
layer - Parse one OCG dict into a
Layer. - parse_
layers - Walk the catalog’s
/OCProperties /OCGsarray and produce oneLayerper OCG. - parse_
usage_ dict - Parse an entire
/Usagedict into aLayerUsage.