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 Long

DLL

int DLSetOptionalContentConfigState(int InstanceID, int OptionalContentConfigID, int OptionalContentGroupID, int NewState);

Parameters

OptionalContentConfigIDThe first default optional content configuration dictionary has an ID of 1. Higher numbers are used for other optional content configuration dictionaries.
OptionalContentGroupIDAn ID returned by the NewOptionalContentGroup, GetOptionalContentGroupID or GetOptionalContentConfigOrderItemID functions
NewStateSpecifies 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

0The state could not be set
1The state was set successfully int OptionalContentConfigID, int OptionalContentGroupID, int NewState);