Foxit PDF SDK
com.foxit.sdk.addon.layoutrecognition.LRContext Class Reference
Inheritance diagram for com.foxit.sdk.addon.layoutrecognition.LRContext:
com.foxit.sdk.common.Base

Public Member Functions

 LRContext (LRContext other)
 Constructor, with another context object.
More...
 
 LRContext (PDFPage page) throws com.foxit.sdk.PDFException
 Constructor, from a PDF Page object.
More...
 
synchronized void delete ()
 Clean up related resources immediately. More...
 
LRStructureElement getRootElement () throws com.foxit.sdk.PDFException
 Get the root element of structure tree.
More...
 
boolean isEmpty ()
 Check whether current object is empty or not.
More...
 
Progressive startParse (PauseCallback pause) throws com.foxit.sdk.PDFException
 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.

Constructor & Destructor Documentation

◆ LRContext() [1/2]

com.foxit.sdk.addon.layoutrecognition.LRContext.LRContext ( PDFPage  page) throws com.foxit.sdk.PDFException

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 , that means user has no right in using layoutrecognition related functions and this constructor will throw exception com.foxit.sdk.common.Constants.e_ErrNoLayoutRecognitionModuleRight .

◆ LRContext() [2/2]

com.foxit.sdk.addon.layoutrecognition.LRContext.LRContext ( LRContext  other)

Constructor, with another context object.

Parameters
[in]otherAnother context object.

Member Function Documentation

◆ delete()

synchronized void com.foxit.sdk.addon.layoutrecognition.LRContext.delete ( )

Clean up related resources immediately.

Returns
None.
Note
Once this function is called, current object cannot be used anymore.

Reimplemented from com.foxit.sdk.common.Base.

◆ getRootElement()

LRStructureElement com.foxit.sdk.addon.layoutrecognition.LRContext.getRootElement ( ) throws com.foxit.sdk.PDFException

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.

◆ isEmpty()

boolean com.foxit.sdk.addon.layoutrecognition.LRContext.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.

◆ startParse()

Progressive com.foxit.sdk.addon.layoutrecognition.LRContext.startParse ( PauseCallback  pause) throws com.foxit.sdk.PDFException

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 com.foxit.sdk.PDFException and values starting from com.foxit.sdk.common.Constants.e_ErrFile .

Parameters
[in]pausePause callback object which decides if the parsing process needs to be paused. This can be null which means not to pause during the parsing process. If this is not null, 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.