Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.pdfbox.util
Class TextPosition

    java.lang.Object
      org.pdfbox.util.TextPosition

public class TextPosition
extends Object

This represents a character and a position on the screen of those characters.

Version:
  $Revision: 1.11 $
Author:
  Ben Litchfield

Constructor Summary
`TextPosition(float xPos, float yPos, float xScl, float yScl, float widthValue, float heightValue, float spaceWidth, String string, PDFont currentFont, float fontSizeValue, float ws)` Constructor.

Method Summary
`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)`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### 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.

Parameters:
  `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

Method Detail

### getCharacter

    public String getCharacter()

  This will the character that will be displayed on the screen.

  Returns:
    The character on the screen.

### getX

    public float getX()

  This will get the x position of the character.

  Returns:
    The x coordinate of the character.

### getY

    public float getY()

  This will get the y position of the character.

  Returns:
    The y coordinate of the character.

### getWidth

    public float getWidth()

  This will get the width of this character.

  Returns:
    The width of this character.

### getHeight

    public float getHeight()

  This will get the maximum height of all characters in this string.

  Returns:
    The maximum height of all characters in this string.

### getFontSize

    public float getFontSize()

  This will get the font size that this object is suppose to be drawn at.

  Returns:
    The font size.

### getFont

    public PDFont getFont()

  This will get the font for the text being drawn.

  Returns:
    The font size.

### getWordSpacing

    public float getWordSpacing()

  This will get the current word spacing.

  Returns:
    The current word spacing.

### 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.

  Returns:
    The width of a space character.

### getXScale

    public float getXScale()

  Returns:
    Returns the xScale.

### setXScale

    public void setXScale(float scale)

  Parameters:
    `scale` - The xScale to set.

### getYScale

    public float getYScale()

  Returns:
    Returns the yScale.

### setYScale

    public void setYScale(float scale)

  Parameters:
    `scale` - The yScale to set.

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD