SetOptionalContentConfigState
Content Streams and Optional Content Groups
Description
This function is used to set the state of an optional content group as defined by the specified optional content configuration dictionary.
All optional content configuration dictionaries have a base state (either ON, OFF or Unchanged) and two membership arrays called /ON and /OFF.
A reference to the optional content group is added to the appropriate /ON or /OFF array (or removed from either array) depending on the value of the base state.
A particular optional content group can only be set to Unchanged if the base state of the optional content configuration dictionary is Unchanged.
The base state of the default optional content configuration dictionary (accessed by setting OptionalContentConfigID to 1) is always ON, so optional content groups in this configuration dictionary can only be set to ON or OFF.
Syntax
Delphi
function TPDFlib.SetOptionalContentConfigState(OptionalContentConfigID, OptionalContentGroupID, NewState: Integer): Integer;ActiveX
Function PDFlib::SetOptionalContentConfigState(OptionalContentConfigID As Long, OptionalContentGroupID As Long, NewState As Long) As LongDLL
int DLSetOptionalContentConfigState(int InstanceID, int OptionalContentConfigID, int OptionalContentGroupID, int NewState);Parameters
| OptionalContentConfigID | The first default optional content configuration dictionary has an ID of 1. Higher numbers are used for other optional content configuration dictionaries. |
|---|---|
| OptionalContentGroupID | An ID returned by the NewOptionalContentGroup, GetOptionalContentGroupID or GetOptionalContentConfigOrderItemID functions |
| NewState | Specifies the state that the optional content group in this configuration dictionary should be set to: 1 = Set to ON 2 = Set to OFF 3 = Set to unchanged (if possible) |
Return values
| 0 | The state could not be set |
|---|---|
| 1 | The state was set successfully int OptionalContentConfigID, int OptionalContentGroupID, int NewState); |