Foxit PDF SDK

Public Member Functions | List of all members
foxit::addon::layoutrecognition::LRContext Class Reference
Inheritance diagram for foxit::addon::layoutrecognition::LRContext:

## Public Member Functions
| LRContext (const LRContext &other)
| Constructor, with another context object. More...
| LRContext (const pdf::PDFPage &page)
| Constructor, from a PDF Page object. More...
| ~LRContext ()
| Destructor.
LRStructureElement | GetRootElement ()
| Get the root element of structure tree. More...
bool | IsEmpty () const
| Check whether current object is empty or not. More...
bool | operator!= (const LRContext &other) const
| Not equal operator. More...
LRContext & | operator= (const LRContext &other)
| Assign operator. More...
bool | operator== (const LRContext &other) const
| Equal operator. More...
common::Progressive | StartParse (common::PauseCallback *pause=0)
| Start to parse layout recognition for related PDF page. More...
Public Member Functions inherited from foxit::Base
FS_HANDLE | Handle () const
| Get the handle of current object. More...

## Detailed Description

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

## Constructor & Destructor Documentation

## ◆ LRContext() [1/2]

foxit::addon::layoutrecognition::LRContext::LRContext | ( | const pdf::PDFPage & | page | ) |

Constructor, from a PDF Page object.

Parameters

  [in] | page | A 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 foxit::e_ErrNoLayoutRecognitionModuleRight.

## ◆ LRContext() [2/2]

foxit::addon::layoutrecognition::LRContext::LRContext | ( | const LRContext & | other | ) |

Constructor, with another context object.

Parameters

  [in] | other | Another context object.

## Member Function Documentation

## ◆ GetRootElement()

LRStructureElement foxit::addon::layoutrecognition::LRContext::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.

## ◆ IsEmpty()

bool foxit::addon::layoutrecognition::LRContext::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::addon::layoutrecognition::LRContext::operator!= | ( | const LRContext & | other | ) | const

Not equal operator.

Parameters

  [in] | other | Another context object. This function will check if current object is not equal to this one.

Returns
  true means not equal, while false means equal.

## ◆ operator=()

LRContext& foxit::addon::layoutrecognition::LRContext::operator= | ( | const LRContext & | other | ) |

Assign operator.

Parameters

  [in] | other | Another context object, whose value would be assigned to current object.

Returns
  Reference to current object itself.

## ◆ operator==()

bool foxit::addon::layoutrecognition::LRContext::operator== | ( | const LRContext & | other | ) | const

Equal operator.

Parameters

  [in] | other | Another context object. This function will check if current object is equal to this one.

Returns
  true means equal, while false means not equal.

## ◆ StartParse()

common::Progressive foxit::addon::layoutrecognition::LRContext::StartParse | ( | common::PauseCallback * | pause = `0` | ) |

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 foxit::e_ErrFile.

Parameters

  [in] | pause | Pause 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. Default value: NULL.

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::Continue to continue the progress until the progress is finished.