DL Logo

PDOCConfig Enumerations

PDOCConfigBaseStates

Header: PDExpT.h:5698

Description

PDOCBaseState enumerates the three legal values for the BaseState key in an optional content configuration dictionary (PDOCConfig). When initializing a PDOCContext using KOCCInit_FromConfig(), this enumeration represents the starting state of the Optional Content Groups (OCGs) before the contents of the config's ON and OFF OCG lists are processed. If the BaseState is Unchanged, and the PDOCConfig is just being constructed, the current states of the OCGs from the PDDoc's own PDOCConfig are used.

Value options for PDOCConfigBaseState.

Enum Constants

kPDOCBaseState_OFF
kPDOCBaseState_ON
kPDOCBaseState_Unchanged

PDOCConfig Typedefs

PDOCConfig

Header: PDExpT.h:5658

Description

A PDOCConfig represents a set of states and other information that is saved in a PDF file for future use. There is a document default configuration, saved in the /D entry in the OCProperties dictionary, and a list of other client configurations, saved as an array of configurations in the /Configs entry in the OCProperties dictionary. PDOCConfig objects are typically used to initialize the OCG states for a client's PDOCContext.

Syntax

typedef struct _t_PDOCConfig *PDOCConfig;

Returned From

Used By

PDOCConfigBaseState

Header: PDExpT.h:5706

Description

PDOCBaseState enumerates the three legal values for the BaseState key in an optional content configuration dictionary (PDOCConfig). When initializing a PDOCContext using KOCCInit_FromConfig(), this enumeration represents the starting state of the Optional Content Groups (OCGs) before the contents of the config's ON and OFF OCG lists are processed. If the BaseState is Unchanged, and the PDOCConfig is just being constructed, the current states of the OCGs from the PDDoc's own PDOCConfig are used.

For value options see PDOCConfigBaseStates.

Syntax

typedef ASUns8 PDOCConfigBaseState;

Used By

PDOCConfig Callback Signatures

PDOCConfigEnumProc

Header: PDExpT.h:5835

Description

A callback used for enumerating optional-content configurations. Enumeration stops when all configurations have been enumerated, or when the callback returns false.

Syntax

ASBool PDOCConfigEnumProc(PDOCConfig occonfig, void *clientData);

Parameters

occonfig
The optional-content configuration object.
clientData
A pointer to user-supplied data to pass to the proc each time it is called.

Returns

true to continue enumeration, false to halt enumeration.

Used By

PDOCConfig Functions

PDOCConfigCreate

Header: PDProcs.h:10038

Description

Creates a new optional-content configuration object.

Related Methods

Syntax

PDOCConfig PDOCConfigCreate(PDDoc pdDoc);

Parameters

pdDoc
The document in which the configuration is used.

Returns

The newly created configuration object.

PDOCConfigDestroy

Header: PDProcs.h:10049

Description

Removes an optional-content configuration object and destroys the Cos objects associated with it. If you pass this method the document's default configuration object (as returned by PDDocGetOCConfig()), nothing happens.

Related Methods

Syntax

void PDOCConfigDestroy(PDOCConfig pdOCCfg);

Parameters

pdOCCfg
The configuration to destroy.

PDOCConfigGetAllRadioButtonGroups

Header: PDProcs.h:10173

Description

Returns an array of pointers to sets of optional-content groups in the configuration that are configured to be mutually exclusive. A set behaves like a radio button group, where only one member can be ON at one time.

Syntax

PDOCG **PDOCConfigGetAllRadioButtonGroups(PDOCConfig pdOCCfg);

Parameters

pdOCCfg
The configuration.

Returns

A NULL-terminated array of pointers to NULL-terminated arrays of optional-content groups (OCGs). The client is responsible for freeing all arrays using ASfree().

PDOCConfigGetCosObj

Header: PDProcs.h:10084

Description

Gets the Cos object associated with the optional-content configuration.

Syntax

CosObj PDOCConfigGetCosObj(PDOCConfig pdOCCfg);

Parameters

pdOCCfg
The configuration for which a CosObj representation is desired.

Returns

A CosObj representation of pdOCCfg.

PDOCConfigGetCreator

Header: PDProcs.h:10269

Description

Gets the creator property for an optional-content configuration.

Syntax

ASText PDOCConfigGetCreator(PDOCConfig pdOCCfg);

Parameters

pdOCCfg
The configuration for which a creator is desired.

Returns

An ASText object containing the creator string from the Creator entry in the configuration's Cos dictionary, or NULL if there is no such entry. The client is responsible for freeing the ASText using ASTextDestroy().

PDOCConfigGetInitState

Header: PDProcs.h:10215

Description

Gets the initial ON-OFF states of optional-content groups in an optional-content configuration.

The client is responsible for freeing storage for the arrays using ASfree().

Syntax

void PDOCConfigGetInitState(PDOCConfig pdOCCfg, PDOCConfigBaseState *bs, PDOCG **onOCGs, PDOCG **offOCGs);

Parameters

pdOCCfg
The configuration for which the initial state is desired.
bs
(Filled by the method) An existing PDOCConfigBaseState structure in which to store the initialization information.
onOCGs
(Filled by the method) A NULL-terminated array of OCGs that have an initial state of ON, or NULL if there are no such groups.
offOCGs
(Filled by the method) A NULL-terminated array of OCGs that have an initial state of OFF, or NULL if there are no such groups.

PDOCConfigGetIntent

Header: PDProcs.h:10327

Description

Gets the Intent entry for an optional-content configuration. An intent is an ASAtom value broadly describing the intended use, either View or Design. A group's content is considered to be optional (that is, the group's state is considered in its visibility) if any intent in its list matches an intent of the context. The intent list of the context is usually set from the intent list of the document configuration.

The intent array contains entries (atoms) terminated by ASAtomNull.

If the configuration has no Intent entry, the default value of View is used. In this case, optional content is disabled for contexts initialized with this configuration.

Syntax

ASAtom *PDOCConfigGetIntent(PDOCConfig pdOCCfg);

Parameters

pdOCCfg
The configuration for which an intent list is desired.

Returns

The ASAtomNull-terminated intent array. The client is responsible for freeing it using ASfree().

PDOCConfigGetLockedArray

Header: PDProcs.h:11223

Description

Returns a PDOCConfig object's list of locked OCGs. The on/off state of a locked OCG cannot be toggled by the user through the user interface.

Syntax

PDOCG *PDOCConfigGetLockedArray(PDOCConfig pdOCCfg);

Parameters

pdOCCfg
The optional-content configuration.

Returns

A NULL-terminated array of PDOCG objects, or NULL if the specified configuration does not contain a list of locked OCGs. The client is responsible for freeing the array using ASfree().

PDOCConfigGetName

Header: PDProcs.h:10241

Description

Gets the name of an optional-content configuration.

Syntax

ASText PDOCConfigGetName(PDOCConfig pdOCCfg);

Parameters

pdOCCfg
The configuration for which a name is desired.

Returns

An ASText object containing the name string from Name entry of the configuration's Cos dictionary, or NULL if there is no Name entry. The client is responsible for freeing the ASText object using ASTextDestroy().

PDOCConfigGetOCGOrder

Header: PDProcs.h:10125

Description

Gets the user interface display order of optional-content groups (OCGs) in an optional-content configuration. This is the order in which the group names are displayed in the Layers panel of Acrobat 6.0 and later.

Related Methods

Syntax

ASBool PDOCConfigGetOCGOrder(PDOCConfig pdOCCfg, CosObj *orderObj);

Parameters

pdOCCfg
The configuration for which an OCG display order is desired.
orderObj

(Filled by the method) A pointer to the Cos object containing the OCG order array. See the description of the Optional Content Groups (OCG) in the ISO 32000-1:2008, Document Management-Portable Document Format-Part 1: PDF 1.7, section 8.11.2, page 222.

You can find this document on the web store of the International Standards Organization (ISO).

Returns

true if the order belongs directly to this configuration, false if it is inherited from the document's default configuration.

PDOCConfigGetPDDoc

Header: PDProcs.h:10074

Description

Gets the document to which the optional-content configuration belongs.

Related Methods

Syntax

PDDoc PDOCConfigGetPDDoc(PDOCConfig pdOCCfg);

Parameters

pdOCCfg
The configuration for which a document is desired.

Returns

The document object.

PDOCConfigGetRadioButtonGroupForOCG

Header: PDProcs.h:10158

Description

Returns an array of optional-content groups in the configuration that contains the specified group, and is configured to behave like a radio button group, where only one member of the set can be ON at one time.

Syntax

PDOCG *PDOCConfigGetRadioButtonGroupForOCG(PDOCConfig pdOCCfg, PDOCG ocg);

Parameters

pdOCCfg
The optional-content configuration.
ocg
The optional-content group for which to obtain the radio-button group.

Returns

A NULL-terminated array of PDOCG objects, or NULL if the specified group does not belong to any radio button group. The client is responsible for freeing the array using ASfree().

PDOCConfigMakeRadioButtonGroup

Header: PDProcs.h:10140

Description

Configures a mutually exclusive set of optional-content groups in an optional-content configuration. The set behaves like a radio button group, where only one OCG from the set can be ON at a time. A client must enforce this in the user interface-level code, not the PD-level code.

Syntax

void PDOCConfigMakeRadioButtonGroup(PDOCConfig pdOCCfg, PDOCG *ocgs);

Parameters

pdOCCfg
The optional-content configuration.
ocgs
A NULL-terminated array of optional-content groups to be included in the group.

PDOCConfigSetCreator

Header: PDProcs.h:10254

Description

Sets the creator property of an optional-content configuration. Stores the specified string as the Creator entry in the configuration's Cos dictionary.

Syntax

void PDOCConfigSetCreator(PDOCConfig pdOCCfg, ASConstText creator);

Parameters

pdOCCfg
The configuration for which to set a creator.
creator
The new creator string.

PDOCConfigSetInitState

Header: PDProcs.h:10192

Description

Sets the initial ON-OFF states of optional-content groups to be saved in an optional-content configuration.

Syntax

void PDOCConfigSetInitState(PDOCConfig pdOCCfg, PDOCConfigBaseState bs, PDOCG *onOCGs, PDOCG *offOCGs);

Parameters

pdOCCfg
The configuration for which to set the initial state.
bs
An existing PDOCConfigBaseState structure containing the initialization information.
onOCGs
A NULL-terminated array of optional-content groups (OCGs) that have an initial state of ON when that is not the base state, or NULL.
offOCGs
A NULL-terminated array of OCGs that have an initial state of OFF when that is not the base state, or NULL.

PDOCConfigSetIntent

Header: PDProcs.h:10298

Description

Sets the Intent entry in an optional-content configuration's Cos dictionary. An intent is an ASAtom value broadly describing the intended use, either View or Design.

A group's content is considered to be optional (that is, the group's state is considered in its visibility) if any intent in its list matches an intent of the context. The intent list of the context is usually set from the intent list of the document configuration.

If the configuration has no Intent entry, the default value of View is used. In this case, optional content is disabled for contexts initialized with this configuration.

Syntax

void PDOCConfigSetIntent(PDOCConfig pdOCCfg, ASAtom *intent);

Parameters

pdOCCfg
The configuration for which to set an intent.
intent
The new Intent entry value, an array of atoms terminated with ASAtomNull. To remove the Intent entry, pass an array with only one element, ASAtom NULL.

PDOCConfigSetLockedArray

Header: PDProcs.h:11238

Description

Sets a PDOCConfig's list of locked OCGs. The on/off state of a locked OCG cannot be toggled by the user through the user interface.

Syntax

void PDOCConfigSetLockedArray(PDOCConfig pdOCCfg, PDOCG *lockedOCGs);

Parameters

pdOCCfg
The optional-content configuration.
lockedOCGs
A NULL-terminated array of PDOCG objects to be used as the locked OCGs for the specified configuration, or NULL if the configuration should not contain a list of locked OCGs.

PDOCConfigSetName

Header: PDProcs.h:10228

Description

Sets the name of an optional-content configuration. It stores the specified string as the Name entry in the configuration's Cos dictionary.

Syntax

void PDOCConfigSetName(PDOCConfig pdOCCfg, ASConstText name);

Parameters

pdOCCfg
The configuration for which to set the name.
name
The new name string.

PDOCConfigSetOCGOrder

Header: PDProcs.h:10103

Description

Sets the user interface display order of optional-content groups (OCGs) in an optional-content configuration. This is the order in which the group names are displayed in the Layers panel of Acrobat 6.0 and later.

Related Methods

Syntax

void PDOCConfigSetOCGOrder(PDOCConfig pdOCCfg, CosObj orderArray);

Parameters

pdOCCfg
The configuration for which a OCG is desired.
orderArray

The Cos object containing the OCG order array. See the description of the Optional Content Groups (OCG) in the ISO 32000-1:2008, Document Management-Portable Document Format-Part 1: PDF 1.7, section 8.11.2, page 222.

You can find this document on the web store of the International Standards Organization (ISO).

Pass NULL to remove any existing order entry.