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
| Name | Type | Access | Description |
|---|---|---|---|
Layers | Layer[] | Read | Gets the layers. |
Default | LayerConfig | Read | Gets the default. |
Configs | LayerConfig[] | Read | Gets the configs. |
Methods
| Signature | Description |
|---|---|
constructor(doc: Document) | Calls constructor(doc) on this OptionalContent instance. |
GetLayer(name: string) → Layer | undefined | Calls 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 | undefined | Calls GetConfig(name) on this OptionalContent instance. |
AddConfig(name: string) → LayerConfig | Calls AddConfig(name) on this OptionalContent instance. |
RemoveConfig(cfg: LayerConfig) | Calls RemoveConfig(cfg) on this OptionalContent instance. |
AddLayer(layerName: string, opts: AddLayerOptions) → Layer | Calls AddLayer(layerName, opts) on this OptionalContent instance. |
RemoveLayer(layer: Layer) | Calls RemoveLayer(layer) on this OptionalContent instance. |