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 ()
 
Returns:
the page number containing the selected text.

int GetRects (double *&rects)
 Gets the list of bounding boxes in the current text selection.
void GetAsUnicode (UString &out_str)
 
Returns:
the current text selection represented as an Unicode string.

const char * GetAsHtml ()
 
Returns:
the current text selection in HTML format.


Detailed Description

A class representing the current text selection.

Member Function Documentation

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

Returns:
the page number containing the selected text.

int pdftron::PDF::PDFView::Selection::GetRects ( double *&  rects  ) 

Gets the list of bounding boxes in the current text selection.

Parameters:
rects - Sets a pointer to an array of points representing a list of bounding boxes for selected text. Each bounding box is represented using 4 numbers in the array of doubles. A first pair of numbers represent the bounding box origin, whereas the second pair represents width and height of the rectangle.
Returns:
the number of rectangles in 'rects' array.
Note:
the 'rects' array is owned by the current selection and does not need to be explicitly released.

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

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

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

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-2008 PDFTron Systems Inc.