com.qoppa.pdf
Interface TextSelection

All Known Implementing Classes:
TextPosition, TextPositionWithContext

public interface TextSelection

Interface that describes selected text. The interface provides methods to get a Shape object and a quadrilateral that encloses the text selection on the page as well as a method to retrieve the selected text as a string.

Author:
Qoppa Software

Method Summary
 Vector getQuadrilaterals()
          Returns a list of quadrilaterals for the text selection areas.
 Shape getSelectionShape()
          Returns the entire shape that encloses all different word groups in this selection.
 String getText()
          Returns a string containing all the selected text.
 

Method Detail

getSelectionShape

Shape getSelectionShape()
Returns the entire shape that encloses all different word groups in this selection. The shape's coordinate system is in 'display' coordinates: The origin of the coordinates are page.getCropBox().getX() and page.getCropBox().getY().

Returns:
A Shape, possibly composed of a number of subshapes, that holds all the selection area.

getText

String getText()
Returns a string containing all the selected text.

Returns:
A string containing all the selected text.

getQuadrilaterals

Vector getQuadrilaterals()
Returns a list of quadrilaterals for the text selection areas. The coordinates of the quadrilaterals is in MediaBox space.

Returns:
A vector of Point2D arrays, each array containing 4 points. The points in each array can be connected by lines in the array order to form the quadrilateral enclosing each selection area.