|
ElegantJ PDF Library Java API Specification v1.1 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.elegantj.pdf.PDFObject
com.elegantj.pdf.PDFGraphicsObject
com.elegantj.pdf.PDFText
This class represents PDF Text object
| Field Summary | |
static int |
CENTER
Possible value for the text's alignment |
static int |
JUSTIFY
Possible value for the text's alignment |
static int |
LEFT
Possible value for the text's alignment |
static int |
RIGHT
Possible value for the text's alignment |
| Fields inherited from class com.elegantj.pdf.PDFGraphicsObject |
BEVEL_JOINS, BUTT_CAPS, MITER_JOINS, ROUND_CAPS, ROUND_JOINS, SQUARE_CAPS |
| Constructor Summary | |
PDFText(java.lang.String text)
Constructs the PDFText with the specified text It will draw the text to the rectangle made by media box and the left alignment will be considered |
|
PDFText(java.lang.String text,
int x,
int y)
Constructs the PDFText with the specified text It will draw the text to the rectangle made by x, y and mediabox's width and height and the left alignment will be considered |
|
PDFText(java.lang.String text,
int upperLeftX,
int upperLeftY,
int lowerRightX,
int lowerRightY)
Constructs the PDFText with the specified text |
|
PDFText(java.lang.String text,
int upperLeftX,
int upperLeftY,
int lowerRightX,
int lowerRightY,
int alignment)
Constructs the PDFText with the specified text |
|
| Method Summary | |
java.lang.Object |
clone()
Returns the clone of this object |
int |
getAlignment()
Returns the alignment for the PDFText |
int |
getCharSpacing()
Method which returns the value of character spacing of this PDFText object |
int |
getFontSize()
Method which returns the font size of this PDFText object |
int |
getHorizontalScaling()
Method which returns the value of horizontal scaling of this PDFText object |
int |
getIndent()
Returns the indent for the PDFText i.e. |
int |
getLastY()
Returns the last Y coordinate of the page after adding the this text to the page this value is useful in case of case1 : If the less text given than the area of the the rectangle build by the upperLeftX, upperLeftY, lowerRightX and lowerRigghtY. case2 : If the upperLeftX, upperLeftY, lowerRightX and lowerRightY not supplied during the PDFText object creation case3 : If the only upperLeftX and upperLeftY have been supplied during the PDFText object creation |
int |
getLowerRightX()
Method which returns the lower right X coordinate value for this PDFText object |
int |
getLowerRightY()
Method which returns the lower right Y coordinate value for this PDFText object |
PDFPattern |
getPattern()
Returns the PDFPattern which is used to fill to this object |
PDFFont |
getPDFFont()
Method which returns the font of this PDFText object |
int |
getRise()
Method which returns the value of text rise of this PDFText object Text rise specifies the amount, to move the baseline up or down from its default location. |
int |
getStringWidth(java.lang.String text)
Returns the string width including the charSpacing, wordSpacing, horizontalScaling accroding to the current font of the PDFText and Font size |
java.lang.String |
getText()
Method which returns the string representing the text for this PDFText object |
int |
getUpperLeftX()
Method which returns the upper left X coordinate value for this PDFText object |
int |
getUpperLeftY()
Method which returns the upper left Y coordinate value for this PDFText object |
int |
getWordSpacing()
Method which returns the value of word spacing of this PDFText object |
boolean |
isOutlineMode()
Method which returns the state of StrokeMode of this PDFText object When StrokeMode is on, the text will be drawn along with stroke color outline |
boolean |
isStrikeOut()
Returns the, wheather strike out is allowed to the PDFText |
boolean |
isUnderLine()
Returns the, wheather under line is allowed to the PDFText |
boolean |
isWrapStyleWord()
Method which returns the wheather wrapping to the PDFText is allowed or not |
java.lang.String |
ligaturize(java.lang.String inStr)
As per Locale perform operation on given string and return processed string |
java.lang.String |
reverseString(java.lang.String str,
java.util.Vector charset)
Reverse characters in given string and return new String if Arabic character found in given charset vector |
void |
setAlignment(int alignment)
Sets the alignment for the PDFText |
void |
setCharSpacing(int n)
Method which set the value of character spacing for this PDFText object |
void |
setFillColor(java.awt.Color fillColor)
Method which sets the fill color of text for this PDFText object |
void |
setFontSize(int size)
Method which sets the font size for this PDFText object |
void |
setHorizontalScaling(int n)
Method which set the value of horizontal scaling for this PDFText object |
void |
setIndent(int indent)
Sets the indent for the PDFText i.e. |
void |
setLowerRightX(int x)
Method which sets the lower right X coordinate value for this PDFText object |
void |
setLowerRightY(int y)
Method which sets the lower right Y coordinate value for this PDFText object |
void |
setOutlineColor(java.awt.Color outLineColor)
Method which sets the outline color of text for this PDFText object Stroke color is used to fill text outlines |
void |
setOutlineMode(boolean flag)
Method which sets the OutlineMode for the text for this PDFText object When OutlineMode is on, the text will be drawn along with outline color outline |
void |
setPattern(PDFPattern pattern)
Sets the PDFPattern to fill this object |
void |
setPDFFont(PDFFont f)
Method which sets the font for this PDFText object |
void |
setRise(int n)
Method which set the value of text rise for this PDFText object Text rise specifies the amount, to move the baseline up or down from its default location. |
void |
setStrikeOut(boolean isStrikeOut)
Sets the, wheather strike out is allowed to the PDFText |
void |
setText(java.lang.String text)
Method which sets the text for this PDFText object |
void |
setUnderLine(boolean isUnderLine)
Sets the, wheather under line is allowed to the PDFText |
void |
setUpperLeftX(int x)
Method which sets the upper left X coordinate value for this PDFText object |
void |
setUpperLeftY(int y)
Method which sets the upper left Y coordinate value for this PDFText object |
void |
setWordSpacing(int n)
Method which set the value of word spacing for this PDFText object |
void |
setWrapStyleWord(boolean isWrapStyleWord)
Method which sets the wheather wrapping to the PDFText is allowed or not The default value for this property is true |
| Methods inherited from class com.elegantj.pdf.PDFObject |
getPDFObjectID, getPDFObjectRefStr, getPDFObjectType, setPDFObjectID, setPDFObjectType |
| Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final int LEFT
public static final int RIGHT
public static final int CENTER
public static final int JUSTIFY
| Constructor Detail |
public PDFText(java.lang.String text)
text - The specified Text,
If the specified text contains new line characters like '\r' or '\n'
the new line character will be appended to the PDF, i.e. the next line
will be drawn to the next line,
If the specified text's length will go out of rectangle width, then
line will be wrapped if the wrapStyleWord is true, i.e. it draws only characters which are fit
to the rectangle width and the remaining characters will be appeared in the
next line
public PDFText(java.lang.String text,
int x,
int y)
text - The specified Text
If the specified text contains new line characters like '\r' or '\n'
the new line character will be appended to the PDF, i.e. the next line
will be drawn to the new line in PDF,
If the specified text's length will go out of rectangle width, then
line will be wrapped, i.e. it draws only characters which are fit
to the rectangle width and the remaining characters will be appeared in the
next linex - The x coordinate, from where text drawn will be startedy - The y coordinate, from where text drawn will be started
public PDFText(java.lang.String text,
int upperLeftX,
int upperLeftY,
int lowerRightX,
int lowerRightY)
text - The specified Text
If the specified text contains new line characters like '\r' or '\n'
the new line character will be appended to the PDF, i.e. the next line
will be drawn to the new line in PDF,
If the specified text's length will go out of rectangle width, then
line will be wrapped, i.e. it draws only characters which are fit
to the rectangle width and the remaining characters will be appeared in the
next lineupperLeftX - The upper left X coordinate of the Box in which text will be drawnupperLeftY - The upper left Y coordinate of the Box in which text will be drawnlowerRightX - The lower right X coordinate of the Box in which text will be drawnlowerRightY - The lower right Y coordinate of the Box in which text will be drawn
default alignment for the text is left will be considered
public PDFText(java.lang.String text,
int upperLeftX,
int upperLeftY,
int lowerRightX,
int lowerRightY,
int alignment)
text - The specified Text
If the specified text contains new line characters like '\r' or '\n'
the new line character will be appended to the PDF, i.e. the next line
will be drawn to the new line in PDF,
If the specified text's length will go out of rectangle width, then
line will be wrapped, i.e. it draws only characters which are fit
to the rectangle width and the remaining characters will be appeared in the
next lineupperLeftX - The upper left X coordinate of the Box in which text will be drawnupperLeftY - The upper left Y coordinate of the Box in which text will be drawnlowerRightX - The lower right X coordinate of the Box in which text will be drawnlowerRightY - The lower right Y coordinate of the Box in which text will be drawnalignment - The alignment for the PDFText, The possible values are LEFT, RIGHT,
CENTER and JUSTIFY| Method Detail |
public void setText(java.lang.String text)
text - The string representing the textpublic java.lang.String getText()
public void setWrapStyleWord(boolean isWrapStyleWord)
isWrapStyleWord - wheather wrapping to the PDFText is allowed or notpublic boolean isWrapStyleWord()
public void setAlignment(int alignment)
alignment - The specified alignment
The possible values are LEFT, CENTER, RIGHT, JUSTIFY
Default is LEFT alignmentpublic int getAlignment()
public void setUpperLeftX(int x)
x - The uppre left X coordinatepublic int getUpperLeftX()
public void setUpperLeftY(int y)
public int getUpperLeftY()
public void setLowerRightX(int x)
x - The lower right X coordinatepublic int getLowerRightX()
public void setLowerRightY(int y)
y - The lower right Y coordinatepublic int getLowerRightY()
public void setIndent(int indent)
indent - The specified value of the indent
The default value is 0
The indent value must be less than the specified PDFText width
It works only with the alignment LEFT and JUSTIFYpublic int getIndent()
public void setCharSpacing(int n)
n - The value of character spacing
If the alignment is JUSTIFY then this not workingpublic int getCharSpacing()
public void setWordSpacing(int n)
n - The value of word spacing
If the alignment is JUSTIFY then this not workingpublic int getWordSpacing()
public void setHorizontalScaling(int n)
n - The value of horizontal scaling
If the alignment is JUSTIFY then this not workingpublic int getHorizontalScaling()
public void setRise(int n)
n - The value of text risepublic int getRise()
public void setPDFFont(PDFFont f)
f - The font for the text objectpublic PDFFont getPDFFont()
public void setFontSize(int size)
size - The font size for the text objectpublic int getFontSize()
public void setFillColor(java.awt.Color fillColor)
fillColor - The fill color of the text for this PDFText objectpublic void setOutlineColor(java.awt.Color outLineColor)
outLineColor - The outline color of the text for this PDFText objectpublic void setOutlineMode(boolean flag)
flag - Sets the state of OutlineModepublic boolean isOutlineMode()
public void setUnderLine(boolean isUnderLine)
isUnderLine - wheather under line is allowed to the PDFTextpublic boolean isUnderLine()
public void setStrikeOut(boolean isStrikeOut)
isStrikeOut - wheather strike out is allowed to the PDFTextpublic boolean isStrikeOut()
public void setPattern(PDFPattern pattern)
public PDFPattern getPattern()
public int getLastY()
public int getStringWidth(java.lang.String text)
public java.lang.String ligaturize(java.lang.String inStr)
inStr - the String
public java.lang.String reverseString(java.lang.String str,
java.util.Vector charset)
str - the Stringcharset - the Vector for character setpublic java.lang.Object clone()
|
ElegantJ PDF Library Java API Specification v1.1 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||