Class Index

Classes


Class PDFNet.OCMD

PDFNet.OCMD

Class Summary
Constructor Attributes Constructor Name and Description
 
The OCMD object represents an Optional Content Membership Dictionary (OCMD) that allows the visibility of optional content to depend on the states in a set of optional-content groups (OCG::Group).
Method Summary
Method Attributes Method Name and Description
 
copy()
Copy Constructor
<static>  
PDFNet.OCMD.create(pdfdoc, ocgs, vis_policy)
Creates a new optional-content membership dictionary (OCMD) object in the given document for the given groups and visibility policy.
<static>  
PDFNet.OCMD.createFromObj(ocmd_dict)
Creates a new optional-content group membership dictionary (OCMD) object from an existing SDF/Cos object.
 
Returns the optional-content groups listed under 'OCGs' entry in the object dictionary.
 
 
 
Returns 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.
 
 
 
setVisibilityPolicy(vis_policy)
Sets 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.
Class Detail
PDFNet.OCMD(id)
The OCMD object represents an Optional Content Membership Dictionary (OCMD) that allows the visibility of optional content to depend on the states in a set of optional-content groups (OCG::Group). The object directly corresponds to the OCMD dictionary (Section 4.10.1 'Optional Content Groups' in PDF Reference).

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).

Parameters:
id
Method Detail
{OCMD} copy()
Copy Constructor
Returns:
{OCMD} A promise that resolves to an object of type: "OCMD" (generated documentation)

<static> {OCMD} PDFNet.OCMD.create(pdfdoc, ocgs, vis_policy)
Creates a new optional-content membership dictionary (OCMD) object in the given document for the given groups and visibility policy.
Parameters:
{PDFDoc} pdfdoc
The document in which the new OCMD will be created.
{Obj} ocgs
An array of optional-content groups (OCGs) to be members of the dictionary.
{number} vis_policy
The visibility policy that determines the visibility of content with respect to the ON-OFF state of OCGs listed in the dictionary.
Returns:
{OCMD} A promise that resolves to the newly created OCG::OCMD object.

<static> {OCMD} PDFNet.OCMD.createFromObj(ocmd_dict)
Creates a new optional-content group membership dictionary (OCMD) object from an existing SDF/Cos object.
Parameters:
{Obj} ocmd_dict
(generated documentation)
Returns:
{OCMD} A promise that resolves to an object of type: "OCMD" (generated documentation)

{Obj} getOCGs()
Returns the optional-content groups listed under 'OCGs' entry in the object dictionary.
Returns:
{Obj} A promise that resolves to a dictionary (for a single OCG::Group object), an SDF::Obj array (for multiple OCG::Group objects) or NULL (for an empty OCMD).

{Obj} getSDFObj()
Returns:
{Obj} A promise that resolves to pointer to the underlying SDF/Cos object.

{Obj} getVisibilityExpression()
Returns:
{Obj} A promise that resolves to if the PDOCMD has a visibility expression entry, return the SDF::Obj array object representing the expression, otherwise returns NULL.

{number} getVisibilityPolicy()
Returns 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.
Return value enum:
PDFNet.OCMD.VisibilityPolicyType = {
	e_AllOn : 0
	e_AnyOn : 1
	e_AnyOff : 2
	e_AllOff : 3
}
Returns:
{number} A promise that resolves to the visibility policy.

{boolean} isCurrentlyVisible(ctx)
Parameters:
{OCGContext} ctx
The context in which the visibility of content is tested.
Returns:
{boolean} A promise that resolves to true if content tagged with this OCMD is visible in the given context, false if it is hidden.

Based on the optional-content groups listed in the dictionary, the current ON-OFF state of those groups within the specified context, and the dictionary's visibility policy, test whether the content tagged with this dictionary would be visible.


{boolean} isValid()
Returns:
{boolean} A promise that resolves to true if this is a valid (non-null) OCMD, false otherwise.

setVisibilityPolicy(vis_policy)
Sets 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.
Parameters:
{number} vis_policy
New visibility policy.

Documentation generated by JsDoc Toolkit 2.4.0 on Fri Sep 09 2016 14:32:41 GMT-0700 (PDT)