PdfOptionalContentConfiguration Class
An optional content configuration (ISO 32000-2, 8.11.4.3): the state of the groups, those the user cannot change, and the groups that behave as radio buttons. The default configuration (/D) gives the state of the groups when the document is opened; the others (/Configs) are alternatives a viewer can offer.
public sealed class PdfOptionalContentConfigurationProperties
| Name | Description |
|---|---|
| BaseState | Gets or sets the state of the groups the configuration does not list (/BaseState). The default is PdfOptionalContentBaseState.On. |
| Creator | Gets or sets the name of the application or the person that created the configuration (/Creator). |
| Dictionary | Gets the configuration dictionary. |
| LockedGroups | Gets the groups the user cannot turn on or off (/Locked). |
| Name | Gets or sets the name of the configuration (/Name). |
| RadioButtonGroups | Gets the sets of groups that behave as radio buttons (/RBGroups): turning a group of a set on turns the others off. |
BaseState
PdfOptionalContentConfiguration.csGets or sets the state of the groups the configuration does not list (/BaseState). The default is PdfOptionalContentBaseState.On.
public PdfOptionalContentBaseState BaseState { get; set; }Property value
Dictionary
PdfOptionalContentConfiguration.csLockedGroups
PdfOptionalContentConfiguration.csGets the groups the user cannot turn on or off (/Locked).
public IReadOnlyList<PdfOptionalContentGroup> LockedGroups { get; }Property value
RadioButtonGroups
PdfOptionalContentConfiguration.csGets the sets of groups that behave as radio buttons (/RBGroups): turning a group of a set on turns the others off.
public IReadOnlyList<IReadOnlyList<PdfOptionalContentGroup>> RadioButtonGroups { get; }Property value
Methods
| Name | Description |
|---|---|
| AddRadioButtonGroup(IEnumerable<PdfOptionalContentGroup>) | Adds a set of groups that behave as radio buttons (/RBGroups). |
| IsVisible(PdfOptionalContentGroup) | Indicates whether a group is visible in this configuration: its base state, unless the configuration lists it on or off. |
| SetLocked(PdfOptionalContentGroup, bool) | Locks or unlocks a group (/Locked): the user cannot turn a locked group on or off. |
| SetVisible(PdfOptionalContentGroup, bool) | Sets the state of a group in this configuration (/ON, /OFF). |
AddRadioButtonGroup(IEnumerable<PdfOptionalContentGroup>)
PdfOptionalContentConfiguration.csAdds a set of groups that behave as radio buttons (/RBGroups).
public void AddRadioButtonGroup(params IEnumerable<PdfOptionalContentGroup> groups)Parameters
groupsIEnumerable<PdfOptionalContentGroup>- The groups.
Exceptions
ArgumentException- A group belongs to another document, or there are fewer than 2 groups.
IsVisible(PdfOptionalContentGroup)
PdfOptionalContentConfiguration.csIndicates whether a group is visible in this configuration: its base state, unless the configuration lists it on or off.
public bool IsVisible(PdfOptionalContentGroup group)Parameters
groupPdfOptionalContentGroup- The group.
Returns
bool true when the group is on; true as well for PdfOptionalContentBaseState.Unchanged and a group not listed.
SetLocked(PdfOptionalContentGroup, bool)
PdfOptionalContentConfiguration.csLocks or unlocks a group (/Locked): the user cannot turn a locked group on or off.
public void SetLocked(PdfOptionalContentGroup group, bool locked)Parameters
groupPdfOptionalContentGroup- The group.
lockedbool- Whether the group is locked.
Exceptions
ArgumentException- The group belongs to another document.
SetVisible(PdfOptionalContentGroup, bool)
PdfOptionalContentConfiguration.csSets the state of a group in this configuration (/ON, /OFF).
public void SetVisible(PdfOptionalContentGroup group, bool visible)Parameters
groupPdfOptionalContentGroup- The group.
visiblebool- Whether the group is on.
Exceptions
ArgumentException- The group belongs to another document.