Top Description Fields Constructors Methods
org.apache.pdfbox.pdmodel.graphics.state

public Class PDTextState

extends Object
implements Cloneable
Class Inheritance
All Implemented Interfaces
java.lang.Cloneable
Imports
org.apache.pdfbox.pdmodel.font.PDFont

This class will hold the current state of the text parameters when executing a content stream.
Author
Ben Litchfield

Field Summary

Modifier and TypeField and Description
private float
private PDFont
private float
private float
private boolean
private float
private RenderingMode
private float
private float

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public PDTextState
clone()

Overrides java.lang.Object.clone.

Creates and returns a copy of this object.

public float

Returns:

The current characterSpacing.
getCharacterSpacing
()

Get the value of the characterSpacing.

public PDFont

Returns:

The font.
getFont
()

Get the value of the font.

public float

Returns:

The fontSize.
getFontSize
()

Get the value of the fontSize.

public float

Returns:

The horizontalScaling.
getHorizontalScaling
()

Get the value of the horizontalScaling.

public boolean

Returns:

The knockout.
getKnockoutFlag
()

Get the value of the knockout.

public float

Returns:

The leading.
getLeading
()

Get the value of the leading.

public RenderingMode

Returns:

The renderingMode.
getRenderingMode
()

Get the value of the renderingMode.

public float

Returns:

The rise.
getRise
()

Get the value of the rise.

public float

Returns:

The wordSpacing.
getWordSpacing
()

Get the value of the wordSpacing.

public void
setCharacterSpacing(float
The characterSpacing.
value
)

Set the value of the characterSpacing.

public void
setFont(PDFont
The font.
value
)

Set the value of the font.

public void
setFontSize(float
The fontSize.
value
)

Set the value of the fontSize.

public void
setHorizontalScaling(float
The horizontalScaling.
value
)

Set the value of the horizontalScaling.

public void
setKnockoutFlag(boolean
The knockout.
value
)

Set the value of the knockout.

public void
setLeading(float
The leading.
value
)

Set the value of the leading.

public void
setRenderingMode(RenderingMode
The renderingMode.
renderingMode
)

Set the value of the renderingMode.

public void
setRise(float
The rise.
value
)

Set the value of the rise.

public void
setWordSpacing(float
The wordSpacing.
value
)

Set the value of the wordSpacing.

Inherited from java.lang.Object:
equalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

characterSpacingback to summary
private float characterSpacing
fontback to summary
private PDFont font
fontSizeback to summary
private float fontSize
horizontalScalingback to summary
private float horizontalScaling
knockoutback to summary
private boolean knockout
leadingback to summary
private float leading
renderingModeback to summary
private RenderingMode renderingMode
riseback to summary
private float rise
wordSpacingback to summary
private float wordSpacing

Constructor Detail

PDTextStateback to summary
public PDTextState()

Method Detail

cloneback to summary
public PDTextState clone()

Overrides java.lang.Object.clone.

Doc from java.lang.Object.clone.

Creates and returns a copy of this object. The precise meaning of "copy" may depend on the class of the object. The general intent is that, for any object x, the expression:

x.clone() != x
will be true, and that the expression:
x.clone().getClass() == x.getClass()
will be true, but these are not absolute requirements. While it is typically the case that:
x.clone().equals(x)
will be true, this is not an absolute requirement.

By convention, the returned object should be obtained by calling super.clone. If a class and all of its superclasses (except Object) obey this convention, it will be the case that x.clone().getClass() == x.getClass().

By convention, the object returned by this method should be independent of this object (which is being cloned). To achieve this independence, it may be necessary to modify one or more fields of the object returned by super.clone before returning it. Typically, this means copying any mutable objects that comprise the internal "deep structure" of the object being cloned and replacing the references to these objects with references to the copies. If a class contains only primitive fields or references to immutable objects, then it is usually the case that no fields in the object returned by super.clone need to be modified.

Returns:PDTextState

a clone of this instance.

Annotations
@Override
getCharacterSpacingback to summary
public float getCharacterSpacing()

Get the value of the characterSpacing.

Returns:float

The current characterSpacing.

getFontback to summary
public PDFont getFont()

Get the value of the font.

Returns:PDFont

The font.

getFontSizeback to summary
public float getFontSize()

Get the value of the fontSize.

Returns:float

The fontSize.

getHorizontalScalingback to summary
public float getHorizontalScaling()

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:float

The horizontalScaling.

getKnockoutFlagback to summary
public boolean getKnockoutFlag()

Get the value of the knockout.

Returns:boolean

The knockout.

getLeadingback to summary
public float getLeading()

Get the value of the leading.

Returns:float

The leading.

getRenderingModeback to summary
public RenderingMode getRenderingMode()

Get the value of the renderingMode.

Returns:RenderingMode

The renderingMode.

getRiseback to summary
public float getRise()

Get the value of the rise.

Returns:float

The rise.

getWordSpacingback to summary
public float getWordSpacing()

Get the value of the wordSpacing.

Returns:float

The wordSpacing.

setCharacterSpacingback to summary
public void setCharacterSpacing(float value)

Set the value of the characterSpacing.

Parameters
value:float

The characterSpacing.

setFontback to summary
public void setFont(PDFont value)

Set the value of the font.

Parameters
value:PDFont

The font.

setFontSizeback to summary
public void setFontSize(float value)

Set the value of the fontSize.

Parameters
value:float

The fontSize.

setHorizontalScalingback to summary
public void setHorizontalScaling(float value)

Set the value of the horizontalScaling.

Parameters
value:float

The horizontalScaling.

setKnockoutFlagback to summary
public void setKnockoutFlag(boolean value)

Set the value of the knockout.

Parameters
value:boolean

The knockout.

setLeadingback to summary
public void setLeading(float value)

Set the value of the leading.

Parameters
value:float

The leading.

setRenderingModeback to summary
public void setRenderingMode(RenderingMode renderingMode)

Set the value of the renderingMode.

Parameters
renderingMode:RenderingMode

The renderingMode.

setRiseback to summary
public void setRise(float value)

Set the value of the rise.

Parameters
value:float

The rise.

setWordSpacingback to summary
public void setWordSpacing(float value)

Set the value of the wordSpacing.

Parameters
value:float

The wordSpacing.