All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
pdftron::PDF::Selection Class Reference

#include <Selection.h>

Public Member Functions

int GetPageNum () const
 
std::vector< QuadPointGetQuads () const
 
UString GetAsUnicode () const
 
const char * GetAsHtml () const
 
int GetQuads (const double *&quads) const
 
void GetAsUnicode (UString &out_str) const
 

Friends

class PDFView
 
class PDFViewCtrl
 

Detailed Description

A class representing the current text selection.

Definition at line 15 of file Selection.h.

Member Function Documentation

const char * pdftron::PDF::Selection::GetAsHtml ( ) const
inline
Returns
the current text selection in HTML format. HTML text will contain styling information such as text color, font size, style etc.
Note
this function can be used to implement clipboard copy and paste that preserves text formating.

Definition at line 148 of file Selection.h.

UString pdftron::PDF::Selection::GetAsUnicode ( ) const
inline
Returns
the current text selection represented as an Unicode string.

Definition at line 141 of file Selection.h.

void pdftron::PDF::Selection::GetAsUnicode ( UString out_str) const
inline

Definition at line 159 of file Selection.h.

int pdftron::PDF::Selection::GetPageNum ( ) const
inline
Returns
the page number containing the selected text.

Definition at line 114 of file Selection.h.

std::vector< QuadPoint > pdftron::PDF::Selection::GetQuads ( ) const
inline

Returns the list of tight bounding quads in the current text selection.

Parameters
quads- Sets a pointer to an array of vertices representing a list of bounding quads for the selected text. Each bounding quad is represented using 8 numbers in an array of doubles. Each two consecutive values represent the x and y coordinates of a quad vertex and the four vertices are arranged counter-clockwisely,
    3--------2
    |        |
    |        |
    |        |
    0--------1

e.g., (quad[0], quad[1]) is the coordinate of vertex 0, and (quad[4], quad[5]) is the coordinate of vertex 2. Note that it is only ensured that the four vertices are arranged sequentially; it is possible in practice that (quad[0], quad[1]) is the coordinate of any vertex.

Returns
the number of quads in 'quads' array.
Note
the 'quads' array is owned by the current selection and does not need to be explicitly released.

Definition at line 124 of file Selection.h.

int pdftron::PDF::Selection::GetQuads ( const double *&  quads) const
inline

Definition at line 154 of file Selection.h.

Friends And Related Function Documentation

friend class PDFView
friend

Definition at line 16 of file Selection.h.

friend class PDFViewCtrl
friend

Definition at line 17 of file Selection.h.


The documentation for this class was generated from the following file: