java.lang.Object | |
↳ | com.pdftron.pdf.ocg.Config |
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.
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Config(Obj ocg_config)
Creates a new optional-content configuration from an existing SDF/Cos object.
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
boolean |
IsValid()
Determine whether configuraiton is valid
| ||||||||||
static Config | __Create(long impl, Object ref) | ||||||||||
static Config |
create(PDFDoc doc, boolean default_config)
Creates a new optional-content configuration object in the document.
| ||||||||||
String |
getCreator()
Get the creator property of an optional-content configuration
| ||||||||||
String |
getInitBaseState()
Get base initialization state
Note: If BaseState is present in the document's default configuration dictionary, its value must be "ON". | ||||||||||
Obj |
getInitOffStates()
Get the initialization of the "OFF" states.
| ||||||||||
Obj |
getInitOnStates()
Get the initialization of the "ON" states.
| ||||||||||
Obj |
getIntent()
Get the intent.
| ||||||||||
Obj |
getLockedOCGs()
Get the locked optional-content groups
| ||||||||||
String |
getName()
Get the name of an option-content configuration
| ||||||||||
Obj |
getOrder()
Get the order of otpional content groups
| ||||||||||
Obj |
getSDFObj()
Get the SDFObj.
| ||||||||||
void |
setCreator(String name)
Set the creator property of an optional-content configuration.
| ||||||||||
void |
setInitBaseState(String state)
Set the base initialization state.
| ||||||||||
void |
setInitOffStates(Obj off_array)
Set the 'OFF' initialization array in the configuration dictionary.
| ||||||||||
void |
setInitOnStates(Obj on_array)
Set the 'ON' initialization array in the configuration dictionary.
| ||||||||||
void |
setIntent(Obj intent)
Set the Intent entry in an optional-content configuration's SDF/Cos dictionary.
| ||||||||||
void |
setLockedOCGs(Obj locked_ocg_array)
Set the array of locked OCGs.
| ||||||||||
void |
setName(String name)
Set the name of an optional-content configuration (suitable for presentation
in a user interface).
| ||||||||||
void |
setOrder(Obj ocgs_array)
Set the user interface display order of optional-content groups (OCGs) in
this configuration.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
|
Creates a new optional-content configuration from an existing SDF/Cos object.
ocg_config | the ocg_config |
---|
Determine whether configuraiton is valid
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 'OCProperies' dictionary). |
PDFNetException |
---|
Get the creator property of an optional-content configuration
PDFNetException |
---|
Get base initialization state
Note: If BaseState is present in the document's default configuration dictionary, its value must be "ON".
After base initialization, the contents of the ON and OFF arrays are processed, overriding the state of the groups included in the arrays.
PDFNetException |
---|
Get the initialization of the "OFF" states.
PDFNetException |
---|
Get the initialization of the "ON" states.
PDFNetException |
---|
Get the intent.
PDFNetException |
---|
Get the locked optional-content groups
PDFNetException |
---|
Get the name of an option-content configuration
PDFNetException |
---|
Get the order of otpional content groups
PDFNetException |
---|
Set 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. |
---|
PDFNetException |
---|
Set the base initialization state. For more info, please see GetInitBaseState().
state | new base state ("ON", "OFF", or "Unchanged"). |
---|
PDFNetException |
---|
Set the 'OFF' initialization array in the configuration dictionary. For more info, please see SetInitOffStates() and section 4.10.3 in PDF Reference.
off_array | the new inits the off states |
---|
PDFNetException |
---|
Set the 'ON' initialization array in the configuration dictionary. For more info, please see SetInitOnStates() and section 4.10.3 in PDF Reference.
on_array | the new inits the on states |
---|
PDFNetException |
---|
Set 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). |
---|
PDFNetException |
---|
Set 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. |
---|
PDFNetException |
---|
Set 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. |
---|
PDFNetException |
---|
Set 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.
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. |
---|
PDFNetException |
---|