org.pdfbox.util
Class TextPosition
java.lang.Object
org.pdfbox.util.TextPosition
public class TextPosition
extends java.lang.Object
This represents a character and a position on the screen of those characters.
TextPosition(float xPos, float yPos, float xScl, float yScl, float widthValue, float heightValue, float spaceWidth, String string, PDFont currentFont, float fontSizeValue, float ws) - Constructor.
|
String | getCharacter() - This will the character that will be displayed on the screen.
|
PDFont | getFont() - This will get the font for the text being drawn.
|
float | getFontSize() - This will get the font size that this object is
suppose to be drawn at.
|
float | getHeight() - This will get the maximum height of all characters in this string.
|
float | getWidth() - This will get the width of this character.
|
float | getWidthOfSpace() - This will get the width of a space character.
|
float | getWordSpacing() - This will get the current word spacing.
|
float | getX() - This will get the x position of the character.
|
float | getXScale()
|
float | getY() - This will get the y position of the character.
|
float | getYScale()
|
void | setXScale(float scale)
|
void | setYScale(float scale)
|
TextPosition
public TextPosition(float xPos,
float yPos,
float xScl,
float yScl,
float widthValue,
float heightValue,
float spaceWidth,
String string,
PDFont currentFont,
float fontSizeValue,
float ws)
Constructor.
xPos
- The x coordinate of the character.yPos
- The y coordinate of the character.xScl
- The x scaling of the character.yScl
- The y scaling of the character.widthValue
- The width of the character.heightValue
- The height of the character.spaceWidth
- The width of the space character.string
- The character to be displayed.currentFont
- The current for for this text position.fontSizeValue
- The new font size.ws
- The word spacing parameter
getCharacter
public String getCharacter()
This will the character that will be displayed on the screen.
- The character on the screen.
getFont
public PDFont getFont()
This will get the font for the text being drawn.
getFontSize
public float getFontSize()
This will get the font size that this object is
suppose to be drawn at.
getHeight
public float getHeight()
This will get the maximum height of all characters in this string.
- The maximum height of all characters in this string.
getWidth
public float getWidth()
This will get the width of this character.
- The width of this character.
getWidthOfSpace
public float getWidthOfSpace()
This will get the width of a space character. This is useful for some
algorithms such as the text stripper, that need to know the width of a
space character.
- The width of a space character.
getWordSpacing
public float getWordSpacing()
This will get the current word spacing.
- The current word spacing.
getX
public float getX()
This will get the x position of the character.
- The x coordinate of the character.
getXScale
public float getXScale()
getY
public float getY()
This will get the y position of the character.
- The y coordinate of the character.
getYScale
public float getYScale()
setXScale
public void setXScale(float scale)
scale
- The xScale to set.
setYScale
public void setYScale(float scale)
scale
- The yScale to set.