public class Config
extends java.lang.Object
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.
Constructor and Description |
---|
Config(Obj ocg_config)
Creates a new optional-content configuration from an existing SDF/Cos object.
|
Modifier and Type | Method and Description |
---|---|
static Config |
__Create(long impl,
java.lang.Object ref) |
static Config |
create(PDFDoc doc,
boolean default_config)
Creates a new optional-content configuration object in the document.
|
java.lang.String |
getCreator()
Get the creator property of an optional-content configuration
|
java.lang.String |
getInitBaseState()
Get base initialization state
|
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
|
java.lang.String |
getName()
Get the name of an option-content configuration
|
Obj |
getOrder()
Get the order of otpional content groups
|
Obj |
getSDFObj()
Get the SDFObj.
|
boolean |
IsValid()
Determine whether configuraiton is valid
|
void |
setCreator(java.lang.String name)
Set the creator property of an optional-content configuration.
|
void |
setInitBaseState(java.lang.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(java.lang.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.
|
public Config(Obj ocg_config)
ocg_config
- the ocg_configpublic static Config create(PDFDoc doc, boolean default_config) throws PDFNetException
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
public boolean IsValid()
public Obj getOrder() throws PDFNetException
PDFNetException
public void setOrder(Obj ocgs_array) throws PDFNetException
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
public java.lang.String getName() throws PDFNetException
PDFNetException
public void setName(java.lang.String name) throws PDFNetException
name
- The new name string.PDFNetException
public java.lang.String getCreator() throws PDFNetException
PDFNetException
public void setCreator(java.lang.String name) throws PDFNetException
name
- The new creator string.PDFNetException
public java.lang.String getInitBaseState() throws PDFNetException
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
public Obj getInitOnStates() throws PDFNetException
PDFNetException
public Obj getInitOffStates() throws PDFNetException
PDFNetException
public void setInitBaseState(java.lang.String state) throws PDFNetException
state
- new base state ("ON", "OFF", or "Unchanged").PDFNetException
public void setInitOnStates(Obj on_array) throws PDFNetException
on_array
- the new inits the on statesPDFNetException
public void setInitOffStates(Obj off_array) throws PDFNetException
off_array
- the new inits the off statesPDFNetException
public Obj getIntent() throws PDFNetException
PDFNetException
public void setIntent(Obj intent) throws PDFNetException
intent
- The new Intent entry value (a name object or an array of name objects).PDFNetException
public Obj getLockedOCGs() throws PDFNetException
PDFNetException
public void setLockedOCGs(Obj locked_ocg_array) throws PDFNetException
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
public Obj getSDFObj() throws PDFNetException
PDFNetException
public static Config __Create(long impl, java.lang.Object ref)