Foxit PDF SDK
FSLayerTree Class Reference
Inheritance diagram for FSLayerTree:
FSBase

Instance Methods

(FSPDFDictionary *) - getDict
 Get the dictionary of current object.
More...
 
(FSPDFArray *) - getOCGs
 Get the "OCGs" PDF array from current object.
More...
 
(FSLayerNode *) - getRootNode
 Get the root layer node.
More...
 
(id) - initWithDocument:
 Constructor, from a PDF document.
More...
 
(id) - initWithOther:
 Constructor, with another layer tree object.
More...
 
(BOOL) - isEmpty
 Check whether current object is empty or not.
More...
 
(BOOL) - setBaseState:
 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 FSLayerTree::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
FSLayerNode

Method Documentation

◆ getDict()

- (FSPDFDictionary *) 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.

◆ getOCGs()

- (FSPDFArray *) 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.

◆ getRootNode()

- (FSLayerNode *) 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.

◆ initWithDocument:()

- (id) initWithDocument: (FSPDFDoc*)  document

Constructor, from a PDF document.

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

Parameters
[in]documentA valid PDF document object.

◆ initWithOther:()

- (id) initWithOther: (FSLayerTree*)  other

Constructor, with another layer tree object.

Parameters
[in]otherAnother layer tree object.

◆ isEmpty()

- (BOOL) isEmpty

Check whether current object is empty or not.

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

Returns
YES means current object is empty, while NO means not.

◆ setBaseState:()

- (BOOL) setBaseState: (FSLayerTreeUsageState 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 FSLayerTreeStateON and this should be one of these values except FSLayerTreeStateUndefined.
Returns
YES means success, while NO means failure.