pdftron::PDF::PDFView::Selection Class Reference

A class representing the current text selection. More...

#include <PDFView.h>

List of all members.

Public Member Functions

int GetPageNum () const
int GetQuads (const double *&quads) const
 Returns the list of tight bounding quads in the current text selection.
void GetAsUnicode (UString &out_str) const
const char * GetAsHtml () const


Detailed Description

A class representing the current text selection.

Member Function Documentation

int pdftron::PDF::PDFView::Selection::GetPageNum (  )  const

Returns:
the page number containing the selected text.

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

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 1, and (quad[4], quad[5]) is the coordinate of vertex 2.

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.

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

Returns:
the current text selection represented as an Unicode string.

const char* pdftron::PDF::PDFView::Selection::GetAsHtml (  )  const

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.


© 2002-2010 PDFTron Systems Inc.