foxit::pdf::LayerTree Class Reference
Inheritance diagram for foxit::pdf::LayerTree:
foxit::Base

Public Types

enum  UsageState { e_StateON = 0x0000, e_StateOFF = 0x0001, e_StateUnchanged = 0x0002, e_StateUndefined = 0x0003 }
 Enumeration for PDF layer base state. More...
 

Public Member Functions

 LayerTree (const PDFDoc &document)
 Constructor, from a PDF document. More...
 
 LayerTree (const LayerTree &other)
 Constructor, with another LayerTree object. More...
 
 ~LayerTree ()
 Destructor.
 
objects::PDFDictionaryGetDict () const
 Get the dictionary of current object. More...
 
objects::PDFArrayGetOCGs () const
 Get the "OCGs" PDF array from current object. More...
 
LayerNode GetRootNode ()
 Get the root layer node. More...
 
bool IsEmpty () const
 Check whether current object is empty or not. More...
 
bool operator!= (const LayerTree &other) const
 Not equal operator. More...
 
LayerTreeoperator= (const LayerTree &other)
 Assign operator. More...
 
bool operator== (const LayerTree &other) const
 Equal operator. More...
 
bool SetBaseState (UsageState state)
 Set the base state for all layers in the default configuration. More...
 
- Public Member Functions inherited from foxit::Base
FS_HANDLE Handle () const
 Get the handle of current object. More...
 

Detailed Description

PDF layer nodes are stored in a PDF layer tree. If user wants to retrieve a layer node, user must construct a PDFLayerTree object from a PDF document first and then call function LayerTree::GetRootNode to get the root layer node of the whole layer tree. Then, user can enumerate all the nodes in the layer tree from the root layer node.

See also
LayerNode

Member Enumeration Documentation

◆ UsageState

Enumeration for PDF layer base state.

Values of this enumeration should be used alone.

Enumerator
e_StateON 

The state is ON.

e_StateOFF 

The state is OFF.

e_StateUnchanged 

The state is unchanged.

e_StateUndefined 

The state is undefined.

Constructor & Destructor Documentation

◆ LayerTree() [1/2]

foxit::pdf::LayerTree::LayerTree ( const PDFDoc document)
explicit

Constructor, from a PDF document.

Currently, the constructed LayerTree object can only be associated with existed layer tree in PDF document. If there is no layer tree in PDF document, functoin LayerTree::IsEmpty of the constructed LayerTree will return true.

Parameters
[in]documentA valid PDF document object.

◆ LayerTree() [2/2]

foxit::pdf::LayerTree::LayerTree ( const LayerTree other)

Constructor, with another LayerTree object.

Parameters
[in]otherAnother LayerTree object.

Member Function Documentation

◆ GetDict()

objects::PDFDictionary* foxit::pdf::LayerTree::GetDict ( ) const

Get the dictionary of current object.

Note
Please refer to "Optional Content Properties Dictionary" in <PDF Reference 1.7> P375 for more details.
Returns
The dictionary of current object.

◆ GetOCGs()

objects::PDFArray* foxit::pdf::LayerTree::GetOCGs ( ) const

Get the "OCGs" PDF array from current object.

Note
Please refer to "Optional Content Properties Dictionary" in <PDF Reference 1.7> P375 for more details.
Returns
The "OCGs" PDF array.

◆ GetRootNode()

LayerNode foxit::pdf::LayerTree::GetRootNode ( )

Get the root layer node.

After getting the root layer node, user can enumerate all layer nodes in current layer tree by functions of class LayerNode.

Returns
Root layer node.

◆ IsEmpty()

bool foxit::pdf::LayerTree::IsEmpty ( ) const

Check whether current object is empty or not.

When the current object is empty, that means current object is useless.

Returns
true means current object is empty, while false means not.

◆ operator!=()

bool foxit::pdf::LayerTree::operator!= ( const LayerTree other) const

Not equal operator.

Parameters
[in]otherAnother LayerTree object. This function will check if current object is not equal to this one.
Returns
true means not equal, while false means equal.

◆ operator=()

LayerTree& foxit::pdf::LayerTree::operator= ( const LayerTree other)

Assign operator.

Parameters
[in]otherAnother LayerTree object, whose value would be assigned to current object.
Returns
Reference to current object itself.

◆ operator==()

bool foxit::pdf::LayerTree::operator== ( const LayerTree other) const

Equal operator.

Parameters
[in]otherAnother LayerTree object. This function will check if current object is equal to this one.
Returns
true means equal, while false means not equal.

◆ SetBaseState()

bool foxit::pdf::LayerTree::SetBaseState ( UsageState  state)

Set the base state for all layers in the default configuration.

If user wants the new state to have effect on rendering result, please construct a new LayerContext object after this function succeeds, and then use the new LayerContext to Renderer to do rendering.
\

Parameters
[in]stateLayer usage state. Please refer to values starting from LayerTree::e_StateON and this should be one of these values except LayerTree::e_StateUndefined.
Returns
true means success, while false means failure.

Foxit Software Corporation Logo
@2018 Foxit Software Incorporated. All rights reserved.