org.pdfbox.pdmodel.text

Class PDTextState

Implemented Interfaces:
Cloneable

public class PDTextState
extends java.lang.Object
implements Cloneable

This class will hold the current state of the text parameters when executing a content stream.
Version:
$Revision: 1.4 $
Author:
Ben Litchfield

Field Summary

static int
RENDERING_MODE_ADD_TEXT_TO_PATH_FOR_CLIPPING
See PDF Reference 1.5 Table 5.3.
static int
RENDERING_MODE_FILL_TEXT
See PDF Reference 1.5 Table 5.3.
static int
RENDERING_MODE_FILL_TEXT_AND_ADD_TO_PATH_FOR_CLIPPING
See PDF Reference 1.5 Table 5.3.
static int
RENDERING_MODE_FILL_THEN_STROKE_TEXT
See PDF Reference 1.5 Table 5.3.
static int
RENDERING_MODE_FILL_THEN_STROKE_TEXT_AND_ADD_TO_PATH_FOR_CLIPPING
See PDF Reference 1.5 Table 5.3.
static int
RENDERING_MODE_NEITHER_FILL_NOR_STROKE_TEXT
See PDF Reference 1.5 Table 5.3.
static int
RENDERING_MODE_STROKE_TEXT
See PDF Reference 1.5 Table 5.3.
static int
RENDERING_MODE_STROKE_TEXT_AND_ADD_TO_PATH_FOR_CLIPPING
See PDF Reference 1.5 Table 5.3.

Method Summary

Object
clone()
float
getCharacterSpacing()
Get the value of the characterSpacing.
PDFont
getFont()
Get the value of the font.
float
getFontSize()
Get the value of the fontSize.
float
getHorizontalScalingPercent()
Get the value of the horizontalScaling.
boolean
getKnockoutFlag()
Get the value of the knockout.
float
getLeading()
Get the value of the leading.
int
getRenderingMode()
Get the value of the renderingMode.
float
getRise()
Get the value of the rise.
float
getWordSpacing()
Get the value of the wordSpacing.
void
setCharacterSpacing(float value)
Set the value of the characterSpacing.
void
setFont(PDFont value)
Set the value of the font.
void
setFontSize(float value)
Set the value of the fontSize.
void
setHorizontalScalingPercent(float value)
Set the value of the horizontalScaling.
void
setKnockoutFlag(boolean value)
Set the value of the knockout.
void
setLeading(float value)
Set the value of the leading.
void
setRenderingMode(int value)
Set the value of the renderingMode.
void
setRise(float value)
Set the value of the rise.
void
setWordSpacing(float value)
Set the value of the wordSpacing.

Field Details

RENDERING_MODE_ADD_TEXT_TO_PATH_FOR_CLIPPING

public static final int RENDERING_MODE_ADD_TEXT_TO_PATH_FOR_CLIPPING
See PDF Reference 1.5 Table 5.3.
Field Value:
7

RENDERING_MODE_FILL_TEXT

public static final int RENDERING_MODE_FILL_TEXT
See PDF Reference 1.5 Table 5.3.
Field Value:
0

RENDERING_MODE_FILL_TEXT_AND_ADD_TO_PATH_FOR_CLIPPING

public static final int RENDERING_MODE_FILL_TEXT_AND_ADD_TO_PATH_FOR_CLIPPING
See PDF Reference 1.5 Table 5.3.
Field Value:
4

RENDERING_MODE_FILL_THEN_STROKE_TEXT

public static final int RENDERING_MODE_FILL_THEN_STROKE_TEXT
See PDF Reference 1.5 Table 5.3.
Field Value:
2

RENDERING_MODE_FILL_THEN_STROKE_TEXT_AND_ADD_TO_PATH_FOR_CLIPPING

public static final int RENDERING_MODE_FILL_THEN_STROKE_TEXT_AND_ADD_TO_PATH_FOR_CLIPPING
See PDF Reference 1.5 Table 5.3.
Field Value:
6

RENDERING_MODE_NEITHER_FILL_NOR_STROKE_TEXT

public static final int RENDERING_MODE_NEITHER_FILL_NOR_STROKE_TEXT
See PDF Reference 1.5 Table 5.3.
Field Value:
3

RENDERING_MODE_STROKE_TEXT

public static final int RENDERING_MODE_STROKE_TEXT
See PDF Reference 1.5 Table 5.3.
Field Value:
1

RENDERING_MODE_STROKE_TEXT_AND_ADD_TO_PATH_FOR_CLIPPING

public static final int RENDERING_MODE_STROKE_TEXT_AND_ADD_TO_PATH_FOR_CLIPPING
See PDF Reference 1.5 Table 5.3.
Field Value:
5

Method Details

clone

public Object clone()

getCharacterSpacing

public float getCharacterSpacing()
Get the value of the characterSpacing.
Returns:
The current characterSpacing.

getFont

public PDFont getFont()
Get the value of the font.
Returns:
The font.

getFontSize

public float getFontSize()
Get the value of the fontSize.
Returns:
The fontSize.

getHorizontalScalingPercent

public float getHorizontalScalingPercent()
Get the value of the horizontalScaling. The default is 100. This value is the percentage value 0-100 and not 0-1. So for mathematical operations you will probably need to divide by 100 first.
Returns:
The horizontalScaling.

getKnockoutFlag

public boolean getKnockoutFlag()
Get the value of the knockout.
Returns:
The knockout.

getLeading

public float getLeading()
Get the value of the leading.
Returns:
The leading.

getRenderingMode

public int getRenderingMode()
Get the value of the renderingMode.
Returns:
The renderingMode.

getRise

public float getRise()
Get the value of the rise.
Returns:
The rise.

getWordSpacing

public float getWordSpacing()
Get the value of the wordSpacing.
Returns:
The wordSpacing.

setCharacterSpacing

public void setCharacterSpacing(float value)
Set the value of the characterSpacing.
Parameters:
value - The characterSpacing.

setFont

public void setFont(PDFont value)
Set the value of the font.
Parameters:
value - The font.

setFontSize

public void setFontSize(float value)
Set the value of the fontSize.
Parameters:
value - The fontSize.

setHorizontalScalingPercent

public void setHorizontalScalingPercent(float value)
Set the value of the horizontalScaling.
Parameters:
value - The horizontalScaling.

setKnockoutFlag

public void setKnockoutFlag(boolean value)
Set the value of the knockout.
Parameters:
value - The knockout.

setLeading

public void setLeading(float value)
Set the value of the leading.
Parameters:
value - The leading.

setRenderingMode

public void setRenderingMode(int value)
Set the value of the renderingMode.
Parameters:
value - The renderingMode.

setRise

public void setRise(float value)
Set the value of the rise.
Parameters:
value - The rise.

setWordSpacing

public void setWordSpacing(float value)
Set the value of the wordSpacing.
Parameters:
value - The wordSpacing.