java.lang.Objectcom.pdfjet.TextBlock
public class TextBlock
Class for creating blocks of text.
Constructor Summary | |
---|---|
TextBlock(Font font)
Creates a text block. |
Method Summary | |
---|---|
TextBlock |
drawOn(Page page)
Draws this text block on the specified page. |
int |
getBgColor()
Returns the background color. |
int |
getBrushColor()
Returns the brush color. |
float |
getHeight()
Returns the text block height. |
float |
getSpaceBetweenLines()
Returns the space between two lines of text. |
int |
getTextAlignment()
Returns the text alignment. |
float |
getWidth()
Returns the text block width. |
TextBlock |
setBgColor(int color)
Sets the background to the specified color. |
TextBlock |
setBrushColor(int color)
Sets the brush color. |
TextBlock |
setFallbackFont(Font fallbackFont)
Sets the fallback font. |
TextBlock |
setHeight(float height)
Sets the height of this text block. |
TextBlock |
setLocation(float x,
float y)
Sets the location where this text block will be drawn on the page. |
TextBlock |
setSpaceBetweenLines(float space)
Sets the space between two lines of text. |
TextBlock |
setText(java.lang.String text)
Sets the block text. |
TextBlock |
setTextAlignment(int textAlign)
Sets the text alignment. |
TextBlock |
setWidth(float width)
Sets the width of this text block. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public TextBlock(Font font)
font
- the text font.Method Detail |
---|
public TextBlock setFallbackFont(Font fallbackFont)
fallbackFont
- the fallback font.
public TextBlock setText(java.lang.String text)
text
- the block text.
public TextBlock setLocation(float x, float y)
x
- the x coordinate of the top left corner of the text block.y
- the y coordinate of the top left corner of the text block.
public TextBlock setWidth(float width)
width
- the specified width.
public float getWidth()
public TextBlock setHeight(float height)
height
- the specified height.
public float getHeight() throws java.lang.Exception
java.lang.Exception
public TextBlock setSpaceBetweenLines(float space)
space
- the space between two lines.
public float getSpaceBetweenLines()
public TextBlock setTextAlignment(int textAlign)
textAlign
- the alignment parameter.
Supported values: Align.LEFT, Align.RIGHT and Align.CENTER.public int getTextAlignment()
public TextBlock setBgColor(int color)
color
- the color specified as 0xRRGGBB integer.
public int getBgColor()
public TextBlock setBrushColor(int color)
color
- the color specified as 0xRRGGBB integer.
public int getBrushColor()
public TextBlock drawOn(Page page) throws java.lang.Exception
page
- the page to draw this text block on.
java.lang.Exception