com.qoppa.pdf
Interface TextSelection


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

public 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

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

Returns:
A string containing all the selected text.

getQuadrilaterals

public Vector getQuadrilaterals()
Returns a list of quadrilaterals for the text selection areas.

Returns:
A vector of double arrays, each containing 8 values. Each array has 4 points in the order: X1 Y1 X2 Y2 X3 Y3 X4 Y4