pdftron.PDF
Class PDFViewCtrl.Selection

java.lang.Object
  extended by pdftron.PDF.PDFViewCtrl.Selection
Enclosing class:
PDFViewCtrl

public class PDFViewCtrl.Selection
extends java.lang.Object

A class representing the current text selection.


Method Summary
 java.lang.String getAsHtml()
          Get the selected text as html.
 java.lang.String getAsUnicode()
          Get the selected text as unicode string
 int getPageNum()
          Get the page number containing the selected text
 double[] getQuads()
          Returns the list of tight bounding quads in the current text selection.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getPageNum

public int getPageNum()
Get the page number containing the selected text

Returns:
the page number containing the selected text.

getQuads

public double[] getQuads()
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, and the first vertex is NOT guaranteed to be the lower-left vertex.
Returns:
the list of bounding boxes

getAsUnicode

public java.lang.String getAsUnicode()
Get the selected text as unicode string

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

getAsHtml

public java.lang.String getAsHtml()
Get the selected text as html.

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