Skip to main content

parse_layers

Function parse_layers 

Source
pub fn parse_layers(resolver: &Resolver<'_>, sink: &WarningSink) -> Vec<Layer>
Expand description

Walk the catalog’s /OCProperties /OCGs array and produce one Layer per OCG.

Returns an empty Vec when the document has no OCGs. Default visibility comes from /OCProperties /D /OFF; locked state from /OCProperties /D /Locked. Both arrays may be indirect-referenced.

Cycles cannot occur (the OCGs array is a flat list of refs), so no visited-set guarding is needed; malformed entries (non-dict, no /Type /OCG) are skipped with a warning.