Optional layers — conditional visibility of content.

Module Returns Deps Description
pdfOCG { typeOCG, typeUsage } pdfErrors, pdfParser OCG dict §8.11.2.
pdfOCConfig { typeOCConfig, typeUsageApp } pdfErrors, pdfParser OC Configuration §8.11.4.

Read pattern

const ocg = runtime.resolve('pdfOCG');
const cfg = runtime.resolve('pdfOCConfig');
const props = catalog.ocProperties;
const groups = props.entries.OCGs.items.map(ref => ocg.typeOCG(resolveRef(ref)));
const defaultCfg = cfg.typeOCConfig(resolveRef(props.entries.D));

See also