DL Logo

PDOCG Typedefs

PDOCG

Header: PDExpT.h:5631

Description

A PDOCG represents a named object whose state can be toggled in a user interface to affect changes in visibility of content.

Syntax

typedef struct _t_PDOCG *PDOCG;

Returned From

Used By

PDOCG Callback Signatures

PDOCGEnumProc

Header: PDExpT.h:5822

Description

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

Syntax

ASBool PDOCGEnumProc(PDOCG ocg, void *clientData);

Parameters

ocg
IN/OUT The optional-content group object.
clientData
IN/OUT 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

PDOCG Functions

PDOCGCreate

Header: PDProcs.h:8843

Description

Creates a new optional-content group (OCG) object in the document. The order of the groups (as returned by PDDocGetOCGs()) is not guaranteed, and is not the same as the display order (see PDOCConfigGetOCGOrder()).

Syntax

PDOCG PDOCGCreate(PDDoc pdDoc, ASConstText name);

Parameters

pdDoc
The document in which the group is used.
name
The name of the optional-content group.

Returns

The newly created group object.

PDOCGCreateFromCosObj

Header: PDProcs.h:8855

Description

Creates a new optional-content group (OCG) object from a Cos object.

Syntax

PDOCG PDOCGCreateFromCosObj(CosObj ocgObj);

Parameters

ocgObj
The Cos object.

Returns

The newly created OCG object.

PDOCGDestroy

Header: PDProcs.h:8867

Description

Destroys an optional-content group (OCG) object. This does not delete any content, but deletes the PDOCG object, destroys the corresponding Cos object, and invalidates references from optional-content membership dictionaries (OCMDs).

Syntax

void PDOCGDestroy(PDOCG pdocg);

Parameters

pdocg
The optional-content group object.

PDOCGGetCosObj

Header: PDProcs.h:8877

Description

Gets the Cos object associated with the optional-content group (OCG) object.

Related Methods

Syntax

CosObj PDOCGGetCosObj(PDOCG pdocg);

Parameters

pdocg
The optional-content group object.

Returns

The Cos object.

PDOCGGetCurrentState

Header: PDProcs.h:9131

Description

Gets the current ON-OFF state of the optional-content group (OCG) object in a given context.

Syntax

ASBool PDOCGGetCurrentState(PDOCG pdocg, PDOCContext ocContext);

Parameters

pdocg
The optional-content group object.
ocContext
The context for which to get the group's state.

Returns

true if the state is ON, false if it is OFF.

PDOCGGetFromCosObj

Header: PDProcs.h:8891

Description

Gets an optional-content group (OCG) object from the associated Cos object. If you call this multiple times for the same PDOCG, it returns the same object.

Syntax

PDOCG PDOCGGetFromCosObj(CosObj obj);

Parameters

obj
The Cos object.

Returns

The OCG object.

PDOCGGetInitialState

Header: PDProcs.h:8966

Description

Gets a initial state ( ON or OFF) of the optional-content group (OCG) object in a given configuration. If the configuration has a BaseState of Unchanged, and the OCG is not listed explicitly in its ON list or OFF list, then the initial state is taken from the OCG's current state in the document's default context, and the method returns false.

Syntax

ASBool PDOCGGetInitialState(PDOCG pdocg, PDOCConfig pdOCCfg, ASBool *initState);

Parameters

pdocg
The optional-content group object.
pdOCCfg
The configuration for which to get the group's initial state.
initState
(Filled by the method) The initial state, true if the state is ON, false if it is OFF.

Returns

true if the initial state is unambiguously defined in the configuration, false otherwise.

PDOCGGetIntent

Header: PDProcs.h:9115

Description

Gets the intent list for an optional-content group. 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.

Syntax

ASAtom *PDOCGGetIntent(PDOCG pdocg);

Parameters

pdocg
The optional-content group object for which the intent is desired.

Returns

An array containing intent entries (ASAtom objects) terminated by ASAtomNull. The client is responsible for freeing it using ASfree().

PDOCGGetLocked

Header: PDProcs.h:11193

Description

Returns the locked state of an OCG in a given configuration. The on/off state of a locked OCG cannot be toggled by the user through the user interface.

Syntax

ASBool PDOCGGetLocked(PDOCG ocg, PDOCConfig pdOCCfg);

Parameters

ocg
IN The PDOCG whose locked state is requested.
pdOCCfg
IN The optional-content configuration.

Returns

An ASBool that is true if the OCG is locked, and false if it is unlocked.

PDOCGGetName

Header: PDProcs.h:8924

Description

Gets the name of an optional-content group. The returned ASText is a copy of the OCG's name. The client is free to modify it and responsible for destroying it.

Related Methods

Syntax

ASText PDOCGGetName(PDOCG pdocg);

Parameters

pdocg
The optional-content group object for which the name is desired.

Returns

The name string.

PDOCGGetPDDoc

Header: PDProcs.h:8903

Description

Gets the document that contains an optional-content group.

Syntax

PDDoc PDOCGGetPDDoc(PDOCG pdocg);

Parameters

pdocg
The optional-content group object for which the document is desired.

Returns

The document object.

PDOCGGetUsageEntry

Header: PDProcs.h:9066

Description

    Gets usage information from an optional-content group (OCG) object. A Usage dictionary entry provides more specific intended usage information than an intent entry. The possible key values are:
  • CreatorInfo
  • Language
  • Export
  • Zoom
  • Print
  • View
  • User
  • PageElement

Syntax

CosObj PDOCGGetUsageEntry(PDOCG pdocg, ASAtom entry);

Parameters

pdocg
The optional-content group object.
entry
The usage key in the usage dictionary entry.

Returns

The usage information associated with the given key in the Usage dictionary for the group, or a NULL Cos object if the operation fails (because the OCG is malformed or has no dictionary, or because the dictionary has no entry corresponding to the given key).

PDOCGGetUserOverride

Header: PDProcs.h:10471

Description

Tests whether the optional-content group is marked as having had its state set directly by client code in the specified context (as opposed to automatically by the optional-content AutoState mechanism).

When a group is so marked, automatic state changes caused by the View event are prevented. When a group's automatic state change is caused by the Export or Print event, the user-override setting for the group is ignored.

A configuration's AS array defines how usage entries are used to automatically manipulate the OCG states. It associates an event ( View, Print, or Export) with a list of OCGs and a category, or list of usage keys identifying OCG usage dictionary entries.

Syntax

ASBool PDOCGGetUserOverride(PDOCG ocg, PDOCContext ctx);

Parameters

ocg
The optional-content group object.
ctx
The context for which the group is tested.

Returns

true if the group is marked as being overridden in the context, false otherwise.

PDOCGHasUsageInfo

Header: PDProcs.h:9036

Description

Tests whether an optional-content group (OCG) object is associated with a Usage dictionary.

Syntax

ASBool PDOCGHasUsageInfo(PDOCG pdocg);

Parameters

pdocg
The optional-content group object.

Returns

true if the group has a Usage dictionary, false otherwise.

PDOCGRemoveInitialState

Header: PDProcs.h:8983

Description

Removes the initial ON-OFF state information for the optional-content group (OCG) object in a given configuration.

Syntax

void PDOCGRemoveInitialState(PDOCG pdocg, PDOCConfig pdOCCfg);

Parameters

pdocg
The optional-content group object.
pdOCCfg
The configuration for which to remove the group's initial state.

PDOCGSetCurrentState

Header: PDProcs.h:9149

Description

Sets the current ON-OFF state of the optional-content group (OCG) object in a given context.

Syntax

void PDOCGSetCurrentState(PDOCG pdocg, PDOCContext ocContext, ASBool newState);

Parameters

pdocg
The optional-content group object.
ocContext
The context for which to set the group's state.
newState
The new state.

PDOCGSetInitialState

Header: PDProcs.h:8942

Description

Sets the initial state ( ON or OFF) of the optional-content group (OCG) object in a given configuration.

Syntax

void PDOCGSetInitialState(PDOCG pdocg, PDOCConfig pdOCCfg, ASBool onOff);

Parameters

pdocg
The optional-content group object.
pdOCCfg
The configuration for which to set the group's initial state.
onOff
The new initial state, true if the state is ON, false if it is OFF.

PDOCGSetIntent

Header: PDProcs.h:9090

Description

Sets the Intent entry in an optional-content group's Cos dictionary. An intent is an ASAtom value broadly describing the intended use, which can be 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.

Syntax

void PDOCGSetIntent(PDOCG pdocg, ASAtom *intent);

Parameters

pdocg
The optional-content group object for which the intent is desired.
intent
The new Intent entry value, an array of atoms terminated with ASAtomNull.

PDOCGSetLocked

Header: PDProcs.h:11208

Description

Sets the locked state of an OCG in a given configuration. The on/off state of a locked OCG cannot be toggled by the user through the user interface.

Syntax

void PDOCGSetLocked(PDOCG ocg, PDOCConfig pdOCCfg, ASBool locked);

Parameters

ocg
IN The PDOCG whose locked state is to be set.
pdOCCfg
IN/OUT The optional-content configuration.
locked
IN An ASBool that is true if the OCG should be locked, and false if it should be unlocked.

PDOCGSetName

Header: PDProcs.h:8912

Description

Sets the name of an optional-content group.

Related Methods

Syntax

void PDOCGSetName(PDOCG pdocg, ASConstText name);

Parameters

pdocg
The optional-content group object.
name
The new name string.

PDOCGSetUsageDictEntry

Header: PDProcs.h:9024

Description

Sets a Usage dictionary entry in an optional-content group (OCG) object. The entry associates usage information with an entry key for retrieval. If a dictionary does not exist, the method creates one.

A Usage dictionary entry provides more specific intended usage information than an intent entry. The possible key values are:

  • CreatorInfo
  • Language
  • Export
  • Zoom
  • Print
  • View
  • User
  • PageElement

The usage value can act as a kind of metadata, describing the sort of things that belong to the group, such as text in French, fine detail on a map, or a watermark. The usage values can also be used by the AutoState mechanism to make decisions about what groups should be on and what groups should be off. The AutoState mechanism considers the usage information in the OCGs, the AS array of the configuration, and external factors; for example, the language the application is running in, the current zoom level on the page, or if the page is being printed.

Syntax

void PDOCGSetUsageDictEntry(PDOCG pdocg, ASAtom usagekey, CosObj usageinfo);

Parameters

pdocg
The optional-content group object.
usagekey
The usage entry key.
usageinfo
The usage information to associate with the key.

PDOCGSetUserOverride

Header: PDProcs.h:10442

Description

Marks the optional-content group as having had its state set directly by client code in the specified context (as opposed to automatically by the optional-content AutoState mechanism).

When a group is so marked, automatic state changes caused by the View event are prevented. When a group's automatic state change is caused by the Export or Print event, the user-override setting for the group is ignored.

A configuration's AS array defines how usage entries are used to automatically manipulate the OCG states. It associates an event ( View, Print, or Export) with a list of OCGs and a category, or list of usage keys identifying OCG usage dictionary entries.

Syntax

void PDOCGSetUserOverride(PDOCG ocg, PDOCContext ctx, ASBool overridden);

Parameters

ocg
The optional-content group object.
ctx
The context for which the group is marked.
overridden
true to mark the group as having had its state set manually, false to clear the mark.

PDOCGUsedInOCConfig

Header: PDProcs.h:9195

Description

Tests whether an optional-content group (OCG) object is used in a context initialized using the given configuration.

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.

Syntax

ASBool PDOCGUsedInOCConfig(PDOCG pdocg, PDOCConfig pdoccfg);

Parameters

pdocg
The optional-content group object.
pdoccfg
The optional-content configuration.

Returns

true if the group is taken into consideration when determining the visibility of content, false otherwise.

PDOCGUsedInOCContext

Header: PDProcs.h:9172

Description

Tests whether an optional-content group (OCG) object is used in a given context.

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.

Syntax

ASBool PDOCGUsedInOCContext(PDOCG pdocg, PDOCContext pdocctx);

Parameters

pdocg
The optional-content group object.
pdocctx
The optional-content context.

Returns

true if the group is taken into consideration when determining the visibility of content, false otherwise.