#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 | 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 |
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.
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
|
inline |
Creates a new optional-content configuration object in the document.
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). |
UString pdftron::PDF::OCG::Config::GetCreator | ( | ) | const |
const char* pdftron::PDF::OCG::Config::GetInitBaseState | ( | ) | const |
After base initialization, the contents of the ON and OFF arrays are processed, overriding the state of the groups included in the arrays.
SDF::Obj pdftron::PDF::OCG::Config::GetInitOffStates | ( | ) | const |
SDF::Obj pdftron::PDF::OCG::Config::GetInitOnStates | ( | ) | const |
SDF::Obj pdftron::PDF::OCG::Config::GetIntent | ( | ) | const |
SDF::Obj pdftron::PDF::OCG::Config::GetLockedOCGs | ( | ) | const |
UString pdftron::PDF::OCG::Config::GetName | ( | ) | const |
SDF::Obj pdftron::PDF::OCG::Config::GetOrder | ( | ) | const |
SDF::Obj pdftron::PDF::OCG::Config::GetSDFObj | ( | ) | const |
|
inline |
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.
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().
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.
off_array | the initialization array to be used. |
void pdftron::PDF::OCG::Config::SetInitOnStates | ( | SDF::Obj | on_array | ) |
Sets the 'ON' initialization array in the configuration dictionary.
on_array | the initialization array to be used |
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().
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.
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.
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.