pdftron::PDF::Highlights Class Reference

Highlights is used to store the necessary information and perform certain tasks in accordance with Adobe's Highlight standard, whose details can be found at:. More...

#include <Highlights.h>

List of all members.

Public Member Functions

 Highlights ()
 Constructor and destructor.
 ~Highlights ()
 Highlights (const Highlights &hlts)
Highlightsoperator= (const Highlights &hlts)
 Assignment operator.
void Load (const UString &file_name)
 Load the Highlight information from a file.
void Save (const UString &file_name)
 Save the current Highlight information in the class to a file.
void Add (const Highlights &hlts)
 Add extra Highlight information into the class.
void Clear ()
 Clear the current Highlight information in the class.
bool GetFirst (int &page, int &position, int &length) const
 Get the information of the first Highlight entity stored in the class.
bool GetNext (int &page, int &position, int &length) const
 Get the information of the next Highlight entity stored in the class.
int GetSize () const
 Get the count of the Highlight entities in the class.


Detailed Description

Highlights is used to store the necessary information and perform certain tasks in accordance with Adobe's Highlight standard, whose details can be found at:.

http://partners.adobe.com/public/developer/en/pdf/HighlightFileFormat.pdf

In a nutshell, the Highlights class maintains a set of Highlight entities. Each Highlight entity contains three pieces of information:

page: the number of the page this Highlight is on; position: the start position (text offset) of this Highlight; length: the length of this Highlight.

Possible use case scenarios for Highlights include:

Note:

For a sample code, please take a look at the TextSearch sample project.


Constructor & Destructor Documentation

pdftron::PDF::Highlights::Highlights (  ) 

Constructor and destructor.

pdftron::PDF::Highlights::~Highlights (  ) 

pdftron::PDF::Highlights::Highlights ( const Highlights hlts  ) 


Member Function Documentation

Highlights& pdftron::PDF::Highlights::operator= ( const Highlights hlts  ) 

Assignment operator.

void pdftron::PDF::Highlights::Load ( const UString file_name  ) 

Load the Highlight information from a file.

Note that the pre-existing Highlight information is discarded.

Parameters:
file_name the name of the file to load from.

void pdftron::PDF::Highlights::Save ( const UString file_name  ) 

Save the current Highlight information in the class to a file.

Parameters:
file_name the name of the file to save to.

void pdftron::PDF::Highlights::Add ( const Highlights hlts  ) 

Add extra Highlight information into the class.

Parameters:
hlts the Highlights of which the Highlight information is to be added.

void pdftron::PDF::Highlights::Clear (  ) 

Clear the current Highlight information in the class.

bool pdftron::PDF::Highlights::GetFirst ( int &  page,
int &  position,
int &  length 
) const

Get the information of the first Highlight entity stored in the class.

Note that the entities are stored in an ascending order. In other words, the entity with the smallest page, position and length values is the one returned by this function, but not the one which is added first. When ordering the entities, the class looks at the page first, then the position, and the length is of the least importance.

Parameters:
page the page number of the first entity.
position the position of the first entity.
length the length of the first entity.
Returns:
false if Highlights contains no Highlight entity.

bool pdftron::PDF::Highlights::GetNext ( int &  page,
int &  position,
int &  length 
) const

Get the information of the next Highlight entity stored in the class.

Parameters:
page the page number of the next entity.
position the position of the next entity.
length the length of the next entity.
Returns:
false if Highlights is empty or it has passed the last entity.

int pdftron::PDF::Highlights::GetSize (  )  const

Get the count of the Highlight entities in the class.

Returns:
the count of the Highlight entities.


© 2002-2010 PDFTron Systems Inc.