- Main Page
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
pdftron::PDF::OCG::Config Class Reference

`#include <Config.h>`

## Public Member Functions
| Config (SDF::Obj ocg_config)
bool | IsValid () const
SDF::Obj | GetOrder () const
void | SetOrder (SDF::Obj ocgs_array)
UString | GetName () const
void | SetName (const UString &name)
UString | GetCreator () const
void | SetCreator (const UString &name)
const char * | GetInitBaseState () const
SDF::Obj | GetInitOnStates () const
SDF::Obj | GetInitOffStates () const
void | SetInitBaseState (const char *state="ON")
void | SetInitOnStates (SDF::Obj on_array)
void | SetInitOffStates (SDF::Obj off_array)
SDF::Obj | GetIntent () const
void | SetIntent (SDF::Obj intent)
SDF::Obj | GetLockedOCGs () const
void | SetLockedOCGs (SDF::Obj locked_ocg_array)
SDF::Obj | GetRBGroups () const
void | SetRBGroups (SDF::Obj rbgroups_array)
SDF::Obj | GetSDFObj () const
| Config (const Config &g)
Config & | operator= (const Config &g)
| Config (TRN_OCGConfig c)

## Static Public Member Functions
static Config | Create (PDFDoc &doc, bool default_config)

## Public Attributes
TRN_OCGConfig | mp_obj

## Detailed Description

The OCG::Config object represents an optional-content (OC) configuration structure (see section 4.10.3 in PDF Reference), used to persist a set of visibility states and other optional-content information in a PDF file A document has a default configuration, saved in the D entry in the 'OCProperties' dictionary (that can be obtained using pdfdoc.GetOCConfig()), and can have a list of other configurations, saved as an array in the 'Configs' entry in the OCProperties dictionary.

Configurations are typically used to initialize the OCG ON-OFF states for an optional-content context (OCG::Context). The OCG order in the configuration is the order in which the groups appear in the Layers panel of a PDF viewer. The configuration can also define a set of mutually exclusive OCGs, called a radio button group.

Definition at line 35 of file Config.h.

## Constructor & Destructor Documentation

pdftron::PDF::OCG::Config::Config | ( | SDF::Obj | ocg_config | ) |

Creates a new optional-content configuration from an existing SDF/Cos object.

pdftron::PDF::OCG::Config::Config | ( | const Config & | g | ) |

Copy constructor

pdftron::PDF::OCG::Config::Config | ( | TRN_OCGConfig | c | ) |
| inline

Definition at line 220 of file Config.h.

## Member Function Documentation

static Config pdftron::PDF::OCG::Config::Create | ( | PDFDoc & | doc,
|  | bool | default_config
| ) |  |
| static

Creates a new optional-content configuration object in the document.

Parameters

  doc | The document in which the new OCG::Config will be created.
  default_config | If true, the configuration will be set as the default OCG configuration (i.e. listed as a D entry under 'OCProperties' dictionary).

Returns
  The newly created configuration object.

UString pdftron::PDF::OCG::Config::GetCreator | ( |  | ) | const

Returns
  the creator property of an optional-content configuration. The string is used to represent the name of the application or feature that created this configuration.

const char* pdftron::PDF::OCG::Config::GetInitBaseState | ( |  | ) | const

Returns
  the base initialization state. This state is used to initialize the states of all the OCGs in a document when this configuration is applied. The value of this entry must be one of the following names: ON: The states of all groups are turned ON. OFF: The states of all groups are turned OFF. Unchanged: The states of all groups are left unchanged.

After base initialization, the contents of the ON and OFF arrays are processed, overriding the state of the groups included in the arrays.

Note
  If BaseState is present in the document's default configuration dictionary, its value must be "ON". ON.

SDF::Obj pdftron::PDF::OCG::Config::GetInitOffStates | ( |  | ) | const

Returns
  the "OFF" initialization array from the configuration dictionary or NULL if the array is not present. The returned object is an array of optional content groups whose state should be set to OFF when this configuration is applied. Note: If the BaseState entry is OFF, this entry is redundant.

SDF::Obj pdftron::PDF::OCG::Config::GetInitOnStates | ( |  | ) | const

Returns
  the "ON" initialization array from the configuration dictionary or NULL if the array is not present. The returned object is an array of optional content groups whose state should be set to ON when this configuration is applied. Note: If the BaseState entry is ON, this entry is redundant.

SDF::Obj pdftron::PDF::OCG::Config::GetIntent | ( |  | ) | const

Returns
  OCG configuration intent. An intent is a name object (or an array of name objects) 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. If the configuration has no Intent entry, the default value of "View" is used.

SDF::Obj pdftron::PDF::OCG::Config::GetLockedOCGs | ( |  | ) | const

Returns
  the list of locked OCGs or NULL if there are no locked OCGs. The on/off state of a locked OCG cannot be toggled by the user through the user interface.

UString pdftron::PDF::OCG::Config::GetName | ( |  | ) | const

Returns
  the name of an optional-content configuration (suitable for presentation in a user interface).

SDF::Obj pdftron::PDF::OCG::Config::GetOrder | ( |  | ) | const

Returns
  the Obj array that specifies the order of optional content (OC) groups in this configuration or NULL if the configuration does not contain any OCGs. The order of OCGs in the array is used to represent the order in which the group names are displayed in the Layers panel of a PDF viewer application. For more information, please refer to Section 4.10.3 in the PDF Reference.

SDF::Obj pdftron::PDF::OCG::Config::GetRBGroups | ( |  | ) | const

Returns
  The Obj array that specifies the radio button groups or NULL if there are no radio button groups. Each group (an array) represents a collection of optional content groups whose states shall be intended to follow a radio button paradigm.

SDF::Obj pdftron::PDF::OCG::Config::GetSDFObj | ( |  | ) | const

Returns
  Pointer to the underlying SDF/Cos object.

bool pdftron::PDF::OCG::Config::IsValid | ( |  | ) | const
| inline

Returns
  true is this is a valid (non-null) configuration, false otherwise.

Definition at line 57 of file Config.h.

Config& pdftron::PDF::OCG::Config::operator= | ( | const Config & | g | ) |

void pdftron::PDF::OCG::Config::SetCreator | ( | const UString & | name | ) |

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

Parameters

  name | The new creator string.

void pdftron::PDF::OCG::Config::SetInitBaseState | ( | const char * | state = `"ON"` | ) |

Sets the base initialization state. For more info, please see GetInitBaseState().

Parameters

  state | new base state ("ON", "OFF", or "Unchanged").

void pdftron::PDF::OCG::Config::SetInitOffStates | ( | SDF::Obj | off_array | ) |

Sets the 'OFF' initialization array in the configuration dictionary.

Parameters

  off_array | the initialization array to be used.

Note
  For more info, please see SetInitOffStates() and section 4.10.3 in PDF Reference.

void pdftron::PDF::OCG::Config::SetInitOnStates | ( | SDF::Obj | on_array | ) |

Sets the 'ON' initialization array in the configuration dictionary.

Parameters

  on_array | the initialization array to be used

Note
  For more info, please see SetInitOnStates() and section 4.10.3 in PDF Reference.

void pdftron::PDF::OCG::Config::SetIntent | ( | SDF::Obj | intent | ) |

Sets the Intent entry in an optional-content configuration's SDF/Cos dictionary. For more information, see GetIntent().

Parameters

  intent | The new Intent entry value (a name object or an array of name objects).

void pdftron::PDF::OCG::Config::SetLockedOCGs | ( | SDF::Obj | locked_ocg_array | ) |

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

Parameters

  locked_ocg_array | An SDF/Cos array of OCG objects to be locked in this configuration, or an empty array if the configuration should not contain locked OCGs. The default is the empty array.

void pdftron::PDF::OCG::Config::SetName | ( | const UString & | name | ) |

Sets the name of an optional-content configuration (suitable for presentation in a user interface). The method stores the specified string as the Name entry in the configuration's SDF/Cos dictionary.

Parameters

  name | The new name string.

void pdftron::PDF::OCG::Config::SetOrder | ( | SDF::Obj | ocgs_array | ) |

Sets the user interface display order of optional-content groups (OCGs) in this configuration. This is the order in which the group names are displayed in the Layers panel of a PDF viewer.

Parameters

  ocgs_array | The SDF/Cos object containing the OCG order array. For more information, please refer to section 4.10.3 in the PDF Reference.

void pdftron::PDF::OCG::Config::SetRBGroups | ( | SDF::Obj | rbgroups_array | ) |

Sets the radio button groups of optional-content groups (OCGs) in this configuration.

Parameters

  rbgroups_array | The SDF/Cos object containing the radio button groups.

## Member Data Documentation

TRN_OCGConfig pdftron::PDF::OCG::Config::mp_obj

Definition at line 221 of file Config.h.

The documentation for this class was generated from the following file:

- PDF/OCG/Config.h