com.pdfjet
Class TextLine

java.lang.Object
  extended by com.pdfjet.TextLine
All Implemented Interfaces:
Drawable

public class TextLine
extends java.lang.Object
implements Drawable

Used to create text line objects.


Constructor Summary
TextLine(Font font)
          Constructor for creating text line objects.
TextLine(Font font, java.lang.String text)
          Constructor for creating text line objects.
 
Method Summary
 float[] drawOn(Page page)
          Draws this text line on the specified page.
 java.lang.String getActualText()
           
 java.lang.String getAltDescription()
           
 int getColor()
          Returns the text line color.
 float getDestinationY()
          Returns the y coordinate of the destination.
 Font getFallbackFont()
          Returns the fallback font.
 Font getFont()
          Gets the font to use for this text line.
 java.lang.String getGoToAction()
          Returns the GoTo action string.
 float getHeight()
          Returns the height of this TextLine.
 java.lang.String getLanguage()
           
 boolean getStrikeout()
          Returns the strikeout flag.
 java.lang.String getText()
          Returns the text.
 int getTextDirection()
          Returns the text direction.
 int getTextEffect()
          Returns the text effect.
 boolean getTrailingSpace()
          Returns the trailing space.
 boolean getUnderline()
          Returns the underline flag.
 java.lang.String getURIAction()
          Returns the action URI.
 float getVerticalOffset()
          Returns the vertical text offset.
 float getWidth()
          Returns the width of this TextLine.
 float getY()
          Returns the y coordinate of the destination.
 TextLine placeIn(Box box)
          Places this text line in the specified box.
 TextLine placeIn(Box box, double x_offset, double y_offset)
          Places this text line in the box at the specified offset.
 TextLine placeIn(Box box, float x_offset, float y_offset)
          Places this text line in the box at the specified offset.
 TextLine setActualText(java.lang.String actualText)
          Sets the actual text for this text line.
 TextLine setAltDescription(java.lang.String altDescription)
          Sets the alternate description of this text line.
 TextLine setColor(int color)
          Sets the color for this text line.
 TextLine setColor(int[] color)
          Sets the pen color.
 TextLine setFallbackFont(Font fallbackFont)
          Sets the fallback font.
 TextLine setFallbackFontSize(float fallbackFontSize)
          Sets the fallback font size to use for this text line.
 TextLine setFont(Font font)
          Sets the font to use for this text line.
 TextLine setFontSize(float fontSize)
          Sets the font size to use for this text line.
 TextLine setGoToAction(java.lang.String key)
          Sets the destination key for the action.
 TextLine setLanguage(java.lang.String language)
           
 TextLine setLocation(float x, float y)
          Sets the location where this text line will be drawn on the page.
 TextLine setPosition(double x, double y)
          Sets the position where this text line will be drawn on the page.
 TextLine setPosition(float x, float y)
          Sets the position where this text line will be drawn on the page.
 TextLine setStrikeout(boolean strikeout)
          Sets the strike variable.
 TextLine setText(java.lang.String text)
          Sets the text.
 TextLine setTextDirection(int degrees)
          Sets the direction in which to draw the text.
 TextLine setTextEffect(int textEffect)
          Sets the text effect.
 TextLine setTrailingSpace(boolean trailingSpace)
          Sets the trailing space after this text line when used in paragraph.
 TextLine setUnderline(boolean underline)
          Sets the underline variable.
 TextLine setURIAction(java.lang.String uri)
          Sets the URI for the "click text line" action.
 TextLine setURIActualText(java.lang.String uriActualText)
           
 TextLine setURIAltDescription(java.lang.String uriAltDescription)
           
 TextLine setURILanguage(java.lang.String uriLanguage)
           
 TextLine setVerticalOffset(float verticalOffset)
          Sets the vertical offset of the text.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TextLine

public TextLine(Font font)
Constructor for creating text line objects.

Parameters:
font - the font to use.

TextLine

public TextLine(Font font,
                java.lang.String text)
Constructor for creating text line objects.

Parameters:
font - the font to use.
text - the text.
Method Detail

setText

public TextLine setText(java.lang.String text)
Sets the text.

Parameters:
text - the text.
Returns:
this TextLine.

getText

public java.lang.String getText()
Returns the text.

Returns:
the text.

setPosition

public TextLine setPosition(double x,
                            double y)
Sets the position where this text line will be drawn on the page.

Parameters:
x - the x coordinate of the text line.
y - the y coordinate of the text line.
Returns:
this TextLine.

setPosition

public TextLine setPosition(float x,
                            float y)
Sets the position where this text line will be drawn on the page.

Parameters:
x - the x coordinate of the text line.
y - the y coordinate of the text line.
Returns:
this TextLine.

setLocation

public TextLine setLocation(float x,
                            float y)
Sets the location where this text line will be drawn on the page.

Parameters:
x - the x coordinate of the text line.
y - the y coordinate of the text line.
Returns:
this TextLine.

setFont

public TextLine setFont(Font font)
Sets the font to use for this text line.

Parameters:
font - the font to use.
Returns:
this TextLine.

getFont

public Font getFont()
Gets the font to use for this text line.

Returns:
font the font to use.

setFontSize

public TextLine setFontSize(float fontSize)
Sets the font size to use for this text line.

Parameters:
fontSize - the fontSize to use.
Returns:
this TextLine.

setFallbackFont

public TextLine setFallbackFont(Font fallbackFont)
Sets the fallback font.

Parameters:
fallbackFont - the fallback font.
Returns:
this TextLine.

setFallbackFontSize

public TextLine setFallbackFontSize(float fallbackFontSize)
Sets the fallback font size to use for this text line.

Parameters:
fallbackFontSize - the fallback font size.
Returns:
this TextLine.

getFallbackFont

public Font getFallbackFont()
Returns the fallback font.

Returns:
the fallback font.

setColor

public TextLine setColor(int color)
Sets the color for this text line.

Parameters:
color - the color is specified as an integer.
Returns:
this TextLine.

setColor

public TextLine setColor(int[] color)
Sets the pen color.

Parameters:
color - the color. See the Color class for predefined values or define your own using 0x00RRGGBB packed integers.
Returns:
this TextLine.

getColor

public int getColor()
Returns the text line color.

Returns:
the text line color.

getDestinationY

public float getDestinationY()
Returns the y coordinate of the destination.

Returns:
the y coordinate of the destination.

getY

public float getY()
Returns the y coordinate of the destination.

Returns:
the y coordinate of the destination.

getWidth

public float getWidth()
Returns the width of this TextLine.

Returns:
the width.

getHeight

public float getHeight()
Returns the height of this TextLine.

Returns:
the height.

setURIAction

public TextLine setURIAction(java.lang.String uri)
Sets the URI for the "click text line" action.

Parameters:
uri - the URI
Returns:
this TextLine.

getURIAction

public java.lang.String getURIAction()
Returns the action URI.

Returns:
the action URI.

setGoToAction

public TextLine setGoToAction(java.lang.String key)
Sets the destination key for the action.

Parameters:
key - the destination name.
Returns:
this TextLine.

getGoToAction

public java.lang.String getGoToAction()
Returns the GoTo action string.

Returns:
the GoTo action string.

setUnderline

public TextLine setUnderline(boolean underline)
Sets the underline variable. If the value of the underline variable is 'true' - the text is underlined.

Parameters:
underline - the underline flag.
Returns:
this TextLine.

getUnderline

public boolean getUnderline()
Returns the underline flag.

Returns:
the underline flag.

setStrikeout

public TextLine setStrikeout(boolean strikeout)
Sets the strike variable. If the value of the strike variable is 'true' - a strike line is drawn through the text.

Parameters:
strikeout - the strikeout flag.
Returns:
this TextLine.

getStrikeout

public boolean getStrikeout()
Returns the strikeout flag.

Returns:
the strikeout flag.

setTextDirection

public TextLine setTextDirection(int degrees)
Sets the direction in which to draw the text.

Parameters:
degrees - the number of degrees.
Returns:
this TextLine.

getTextDirection

public int getTextDirection()
Returns the text direction.

Returns:
the text direction.

setTextEffect

public TextLine setTextEffect(int textEffect)
Sets the text effect.

Parameters:
textEffect - Effect.NORMAL, Effect.SUBSCRIPT or Effect.SUPERSCRIPT.
Returns:
this TextLine.

getTextEffect

public int getTextEffect()
Returns the text effect.

Returns:
the text effect.

setVerticalOffset

public TextLine setVerticalOffset(float verticalOffset)
Sets the vertical offset of the text.

Parameters:
verticalOffset - the vertical offset.
Returns:
this TextLine.

getVerticalOffset

public float getVerticalOffset()
Returns the vertical text offset.

Returns:
the vertical text offset.

setTrailingSpace

public TextLine setTrailingSpace(boolean trailingSpace)
Sets the trailing space after this text line when used in paragraph.

Parameters:
trailingSpace - the trailing space.
Returns:
this TextLine.

getTrailingSpace

public boolean getTrailingSpace()
Returns the trailing space.

Returns:
the trailing space.

setLanguage

public TextLine setLanguage(java.lang.String language)

getLanguage

public java.lang.String getLanguage()

setAltDescription

public TextLine setAltDescription(java.lang.String altDescription)
Sets the alternate description of this text line.

Parameters:
altDescription - the alternate description of the text line.
Returns:
this TextLine.

getAltDescription

public java.lang.String getAltDescription()

setActualText

public TextLine setActualText(java.lang.String actualText)
Sets the actual text for this text line.

Parameters:
actualText - the actual text for the text line.
Returns:
this TextLine.

getActualText

public java.lang.String getActualText()

setURILanguage

public TextLine setURILanguage(java.lang.String uriLanguage)

setURIAltDescription

public TextLine setURIAltDescription(java.lang.String uriAltDescription)

setURIActualText

public TextLine setURIActualText(java.lang.String uriActualText)

placeIn

public TextLine placeIn(Box box)
                 throws java.lang.Exception
Places this text line in the specified box.

Parameters:
box - the specified box.
Returns:
this TextLine.
Throws:
java.lang.Exception

placeIn

public TextLine placeIn(Box box,
                        double x_offset,
                        double y_offset)
                 throws java.lang.Exception
Places this text line in the box at the specified offset.

Parameters:
box - the specified box.
x_offset - the x offset from the top left corner of the box.
y_offset - the y offset from the top left corner of the box.
Returns:
this TextLine.
Throws:
java.lang.Exception

placeIn

public TextLine placeIn(Box box,
                        float x_offset,
                        float y_offset)
                 throws java.lang.Exception
Places this text line in the box at the specified offset.

Parameters:
box - the specified box.
x_offset - the x offset from the top left corner of the box.
y_offset - the y offset from the top left corner of the box.
Returns:
this TextLine.
Throws:
java.lang.Exception

drawOn

public float[] drawOn(Page page)
               throws java.lang.Exception
Draws this text line on the specified page.

Specified by:
drawOn in interface Drawable
Parameters:
page - the page to draw this text line on.
Returns:
x and y coordinates of the bottom right corner of this component.
Throws:
java.lang.Exception