PdfOptionalContentProperties Class

The optional content of a document (/OCProperties, ISO 32000-2, 8.11.4): its groups (the layers) and its configurations. The dictionary is created when a group is added.

public sealed class PdfOptionalContentProperties

Properties

NameDescription
ConfigurationsGets the alternate configurations (/Configs).
DefaultConfigurationGets the default configuration (/D): the state of the groups when the document is opened; null when the document has no optional content.
DictionaryGets the optional content properties dictionary of the catalog, or null when the document has none.
GroupsGets the groups of the document (/OCGs).

Gets the alternate configurations (/Configs).

public IReadOnlyList<PdfOptionalContentConfiguration> Configurations { get; }

Gets the default configuration (/D): the state of the groups when the document is opened; null when the document has no optional content.

public PdfOptionalContentConfiguration? DefaultConfiguration { get; }

Gets the optional content properties dictionary of the catalog, or null when the document has none.

public PdfDictionary? Dictionary { get; }

Property value

PdfDictionary?

Gets the groups of the document (/OCGs).

public IReadOnlyList<PdfOptionalContentGroup> Groups { get; }

Methods

NameDescription
AddGroup(string, bool)Adds a group to the document, at the end of the list of layers viewers show (/Order of the default configuration).

AddGroup(string, bool)

PdfOptionalContentProperties.cs

Adds a group to the document, at the end of the list of layers viewers show (/Order of the default configuration).

public PdfOptionalContentGroup AddGroup(string name, bool visible = true)

Parameters

name string
The name of the group.
visible bool
Whether the group is visible when the document is opened.

Returns

PdfOptionalContentGroup The group.