![]() |
#include <Highlights.h>
Public Member Functions | |
Highlights () | |
Constructor and destructor. | |
~Highlights () | |
Highlights (const Highlights &hlts) | |
Highlights & | operator= (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. |
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.
pdftron::PDF::Highlights::Highlights | ( | ) |
Constructor and destructor.
pdftron::PDF::Highlights::~Highlights | ( | ) |
pdftron::PDF::Highlights::Highlights | ( | const Highlights & | hlts | ) |
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.
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.
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.
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.
page | the page number of the first entity. | |
position | the position of the first entity. | |
length | the length of the first 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.
page | the page number of the next entity. | |
position | the position of the next entity. | |
length | the length of the next entity. |
int pdftron::PDF::Highlights::GetSize | ( | ) | const |
Get the count of the Highlight entities in the class.