public class OCMD
extends java.lang.Object
An OCMD collects a set of OCGs. It sets a visibility policy, so that content in the member groups is visible only when all groups are ON or OFF, or when any of the groups is ON or OFF. This makes it possible to set up complex dependencies among groups. For example, an object can be visible only if some other conditions are met (such as if another layer is visible).
Modifier and Type | Field and Description |
---|---|
static int |
e_AllOff
The Constant e_AllOff.
|
static int |
e_AllOn
Visibility Policy Type.
|
static int |
e_AnyOff
The Constant e_AnyOff.
|
static int |
e_AnyOn
The Constant e_AnyOn.
|
Constructor and Description |
---|
OCMD(Obj ocmd)
Creates a new optional-content group (OCG) object from an existing
SDF/Cos object.
|
Modifier and Type | Method and Description |
---|---|
static OCMD |
__Create(long impl,
java.lang.Object ref) |
static OCMD |
create(PDFDoc doc,
Obj ocgs,
int vis_policy)
Creates a new optional-content membership dictionary (OCMD) object in the
given document for the given groups and visibility policy.
|
Obj |
getOCGs()
Get the optional-content groups listed under 'OCGs' entry in the object
dictionary.
|
Obj |
getSDFObj()
Get the SDFObj.
|
Obj |
getVisibilityExpression()
Get the visibility expression.
|
int |
getVisibilityPolicy()
Get the optional-content membership dictionary's visibility policy, which
determines the visibility of content with respect to the ON-OFF state of
OCGs listed in the dictionary.
|
boolean |
isValid()
Determine whether OCMD is valid
|
void |
setVisibilityPolicy(int vis_policy)
Set the optional-content membership dictionary's visibility policy, which
determines the visibility of content with respect to the ON-OFF state of
OCGs listed in the dictionary.
|
public static final int e_AllOn
public static final int e_AnyOn
public static final int e_AnyOff
public static final int e_AllOff
public OCMD(Obj ocmd)
ocmd
- the ocmdpublic static OCMD create(PDFDoc doc, Obj ocgs, int vis_policy) throws PDFNetException
doc
- The document in which the new OCMD will be created.ocgs
- An array of optional-content groups (OCGs) to be members of the dictionary.vis_policy
- the vis_policyPDFNetException
public boolean isValid() throws PDFNetException
PDFNetException
public Obj getOCGs() throws PDFNetException
PDFNetException
public int getVisibilityPolicy() throws PDFNetException
PDFNetException
public void setVisibilityPolicy(int vis_policy) throws PDFNetException
vis_policy
- New visibility policy.PDFNetException
public Obj getVisibilityExpression() throws PDFNetException
PDFNetException
public Obj getSDFObj() throws PDFNetException
PDFNetException
public static OCMD __Create(long impl, java.lang.Object ref)