OptionalContent

Overview

OptionalContent is a class in Aspose.PDF FOSS for TypeScript.

The document’s optional-content properties (/OCProperties).

This class declares 8 methods for OptionalContent objects in TypeScript programs. Available methods include: AddConfig, AddLayer, GetConfig, GetLayer, RemoveConfig, RemoveLayer, constructor, layerForRef. All public members are accessible to any TypeScript application after installing the Aspose.PDF FOSS for TypeScript package. Properties: Configs, Default, Layers.

Properties

NameTypeAccessDescription
LayersLayer[]ReadGets the layers.
DefaultLayerConfigReadGets the default.
ConfigsLayerConfig[]ReadGets the configs.

Methods

SignatureDescription
constructor(doc: Document)Calls constructor(doc) on this OptionalContent instance.
GetLayer(name: string)Layer | undefinedCalls GetLayer(name) on this OptionalContent instance.
layerForRef(r: PdfObject | undefined)Layer | undefined@internal Map an OCG ref back to a Layer handle.
GetConfig(name: string)LayerConfig | undefinedCalls GetConfig(name) on this OptionalContent instance.
AddConfig(name: string)LayerConfigCalls AddConfig(name) on this OptionalContent instance.
RemoveConfig(cfg: LayerConfig)Calls RemoveConfig(cfg) on this OptionalContent instance.
AddLayer(layerName: string, opts: AddLayerOptions)LayerCalls AddLayer(layerName, opts) on this OptionalContent instance.
RemoveLayer(layer: Layer)Calls RemoveLayer(layer) on this OptionalContent instance.