com.qoppa.pdf
Class TextPosition

java.lang.Object
  extended bycom.qoppa.pdf.TextPosition

public class TextPosition
extends Object


Constructor Summary
TextPosition(String text, Shape textShape, Point2D.Double[] quad, double angle)
           
 
Method Summary
 double getAngle()
          Returns the angle that this text is displayed at on the page.
 Shape getEnclosingShape()
          Returns a shape that encloses the text on the page.
 Point2D.Double[] getQuadrilateral()
          Returns a quadrilateral with the four corners for this text string.
 String getText()
          Returns the text string.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TextPosition

public TextPosition(String text,
                    Shape textShape,
                    Point2D.Double[] quad,
                    double angle)
Method Detail

getEnclosingShape

public Shape getEnclosingShape()
Returns a shape that encloses the text on the page. 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 that holds the string.

getText

public String getText()
Returns the text string.

Returns:
The text.

getQuadrilateral

public Point2D.Double[] getQuadrilateral()
Returns a quadrilateral with the four corners for this text string. The coordinates of the quadrilaterals is in MediaBox space.

Returns:
An array of 4 Point2D object. The points in can be connected by lines in the array order to form the quadrilateral enclosing the text.

getAngle

public double getAngle()
Returns the angle that this text is displayed at on the page.

Returns:
The angle of the text