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

Instance Methods

(FSLRStructureElement *) - getRootElement
 Get the root element of structure tree.
More...
 
(id) - initWithOther:
 Constructor, with another context object.
More...
 
(id) - initWithPage:
 Constructor, from a PDF Page object.
More...
 
(BOOL) - isEmpty
 Check whether current object is empty or not.
More...
 
(FSProgressive *) - startParse:
 Start to parse layout recognition for related PDF page.
More...
 

Detailed Description

This class can be used to parse layout recognition to get the root element.

Method Documentation

◆ getRootElement()

- (FSLRStructureElement *) getRootElement

Get the root element of structure tree.

Please ensure current context object has been parsed successfully before calling this function; otherwise, no valid root structure element can be retrieved.

Returns
Root element.

◆ initWithOther:()

- (id) initWithOther: (FSLRContext*)  other

Constructor, with another context object.

Parameters
[in]otherAnother context object.

◆ initWithPage:()

- (id) initWithPage: (FSPDFPage*)  page

Constructor, from a PDF Page object.

Parameters
[in]pageA valid PDF page object.
Note
If module "LayoutRecognition" is not defined in the license information which is used in function common::Library::initialize:key:, that means user has no right in using layoutrecognition related functions and this constructor will throw exception FSErrNoLayoutRecognitionModuleRight.

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

◆ startParse:()

- (FSProgressive *) startParse: (id<FSPauseCallback>)  pause

Start to parse layout recognition for related PDF page.

It may take a long time to do parsing, so Foxit PDF SDK uses a progressive process to do this. If there is any error occurs in parsing progress, this function will throw exception. Please refer to class foxit::Exception and values starting from FSErrFile.

Parameters
[in]pausePause callback object which decides if the parsing process needs to be paused. This can be nil which means not to pause during the parsing process. If this is not nil, it should be a valid pause object implemented by user.
Returns
A progressive object. Please check the rate of current progress by function common::Progressive::getRateOfProgress. If the rate is not 100 yet, call function common::Progressive::resume to continue the progress until the progress is finished.