Foxit PDF SDK
fsdk.LayerTree Class Reference

Public Member Functions

def GetDict ()
 Get the dictionary of current object.
More...
 
def GetOCGs ()
 Get the "OCGs" PDF array from current object.
More...
 
def GetOCGsByPageIndex (page_index)
 Get an array of OCG objects found on a specified page.
More...
 
def GetRootNode ()
 Get the root layer node.
More...
 
def IsEmpty ()
 Check whether current object is empty or not.
More...
 
def SetBaseState (state)
 Set the base state for all layers in the default configuration.
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 layer tree object from a PDF document first and then call function fsdk.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 Function Documentation

◆ GetDict()

def fsdk.LayerTree.GetDict ( )

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. If there is any error, this function will return null.

◆ GetOCGs()

def fsdk.LayerTree.GetOCGs ( )

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. If there is no "OCGs" entry or any error occurs, this function will return null.

◆ GetOCGsByPageIndex()

def fsdk.LayerTree.GetOCGsByPageIndex (   page_index)

Get an array of OCG objects found on a specified page.

Parameters
[in]page_indexIndex of the page of child to be retrieved. Valid range: from 0 to (count-1). count is returned by function fsdk.PDFDoc.GetPageCount .
Returns
A layer node array object.

◆ GetRootNode()

def fsdk.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()

def fsdk.LayerTree.IsEmpty ( )

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.

◆ SetBaseState()

def fsdk.LayerTree.SetBaseState (   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 layer context 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 fsdk.LayerTreeE_StateON and this should be one of these values except fsdk.LayerTreeE_StateUndefined .
Returns
true means success, while false means failure.