TextStamp

Inheritance: java.lang.Object, com.aspose.pdf.Stamp

public class TextStamp extends Stamp

Reresents textual stamp.

Constructors

ConstructorDescription
TextStamp(String value)Initializes a new instance of the TextStamp class.
TextStamp(String value, TextState textState)Initializes a new instance of the TextStamp class.
TextStamp(FormattedText formattedText)Initializes a new instance of the TextStamp class with formattedText object

Methods

MethodDescription
getDefaultFontSize()Default Font Size
getDraw()This property determines how stamp is drawn on page.
setDraw(boolean value)This property determines how stamp is drawn on page.
getTreatYIndentAsBaseLine()Defines coordinate origin for placing text.
setTreatYIndentAsBaseLine(boolean value)Defines coordinate origin for placing text.
isWordWrap()Defines word wrap.
setWordWrap(boolean value)Defines word wrap.
isJustify()Defines text justification.
setJustify(boolean value)Defines text justification.
isScale()Defines scaling of the text.
setScale(boolean value)Defines scaling of the text.
getDefaultFont()Returns default font
getValue()Gets string value which is used as stamp on the page.
setValue(String value)Sets string value which is used as stamp on the page.
getTextState()Gets text properties of the stamp.
getTextAlignment()Alignment of the text inside the stamp.
setTextAlignment(HorizontalAlignment value)Alignment of the text inside the stamp.
put(Page page)Adds textual stamp on the page.
getWidth()Desired width of the stamp on the page.
setWidth(double value)Desired width of the stamp on the page.
getHeight()Desired height of the stamp on the page.
setHeight(double value)Desired height of the stamp on the page.
getMaxRowWidth()Max row height for WordWrap option.
setMaxRowWidth(double value)Max row height for WordWrap option.

TextStamp(String value)

public TextStamp(String value)

Initializes a new instance of the TextStamp class.

Parameters:

ParameterTypeDescription
valuejava.lang.StringStamp value.

TextStamp(String value, TextState textState)

public TextStamp(String value, TextState textState)

Initializes a new instance of the TextStamp class.

Parameters:

ParameterTypeDescription
valuejava.lang.StringStamp value.
textStateTextStateStamp text state.

TextStamp(FormattedText formattedText)

public TextStamp(FormattedText formattedText)

Initializes a new instance of the TextStamp class with formattedText object

Parameters:

ParameterTypeDescription
formattedTextFormattedTextFormattedText object which contains text of the stamp.

getDefaultFontSize()

public static float getDefaultFontSize()

Default Font Size

Returns: float - float value

getDraw()

public boolean getDraw()

This property determines how stamp is drawn on page. If Draw = true stamp is drawn as graphic operators and if draw = false then stamp is drawn as text.

Returns: boolean - boolean value

setDraw(boolean value)

public void setDraw(boolean value)

This property determines how stamp is drawn on page. If Draw = true stamp is drawn as graphic operators and if draw = false then stamp is drawn as text.

Parameters:

ParameterTypeDescription
valuebooleanboolean value

getTreatYIndentAsBaseLine()

public boolean getTreatYIndentAsBaseLine()

Defines coordinate origin for placing text. If TreatYIndentAsBaseLine = true (default when Draw = true) YIndent value will be treated as text base line. If TreatYIndentAsBaseLine = false (default when Draw = false) YIndent value will be treated as bottom (descent line) of text.

Returns: boolean - boolean value

setTreatYIndentAsBaseLine(boolean value)

public void setTreatYIndentAsBaseLine(boolean value)

Defines coordinate origin for placing text. If TreatYIndentAsBaseLine = true (default when Draw = true) YIndent value will be treated as text base line. If TreatYIndentAsBaseLine = false (default when Draw = false) YIndent value will be treated as bottom (descent line) of text.

Parameters:

ParameterTypeDescription
valuebooleanboolean value

isWordWrap()

public boolean isWordWrap()

Defines word wrap. If this property set to true and Width value specified, text will be broken in the several lines to fit into specified width. Default value: false.

Returns: boolean - boolean value

setWordWrap(boolean value)

public void setWordWrap(boolean value)

Defines word wrap. If this property set to true and Width value specified, text will be broken in the several lines to fit into specified width. Default value: false.

Parameters:

ParameterTypeDescription
valuebooleanboolean value

isJustify()

public boolean isJustify()

Defines text justification. If this property is set to true, both left and right edges of the text are aligned. Default value: false.

Returns: boolean - boolean value

setJustify(boolean value)

public void setJustify(boolean value)

Defines text justification. If this property is set to true, both left and right edges of the text are aligned. Default value: false.

Parameters:

ParameterTypeDescription
valuebooleanboolean value

isScale()

public boolean isScale()

Defines scaling of the text. If this property is set to true and Width value specified, text will be scaled in order to fit to specified width.

Returns: boolean - boolean value

setScale(boolean value)

public void setScale(boolean value)

Defines scaling of the text. If this property is set to true and Width value specified, text will be scaled in order to fit to specified width.

Parameters:

ParameterTypeDescription
valuebooleanboolean value

getDefaultFont()

public static Font getDefaultFont()

Returns default font

Returns: Font - com.aspose.pdf.Font object

getValue()

public String getValue()

Gets string value which is used as stamp on the page.

Returns: java.lang.String - String value

setValue(String value)

public void setValue(String value)

Sets string value which is used as stamp on the page.

Parameters:

ParameterTypeDescription
valuejava.lang.StringString value

getTextState()

public TextState getTextState()

Gets text properties of the stamp. See TextState for details.

Returns: TextState - TextState element

getTextAlignment()

public HorizontalAlignment getTextAlignment()

Alignment of the text inside the stamp.

Returns: HorizontalAlignment - HorizontalAlignment value

setTextAlignment(HorizontalAlignment value)

public void setTextAlignment(HorizontalAlignment value)

Alignment of the text inside the stamp.

Parameters:

ParameterTypeDescription
valueHorizontalAlignmentHorizontalAlignment value

put(Page page)

public void put(Page page)

Adds textual stamp on the page.

Parameters:

ParameterTypeDescription
pagePagePage for stamping.

getWidth()

public double getWidth()

Desired width of the stamp on the page.

Returns: double - double value

setWidth(double value)

public void setWidth(double value)

Desired width of the stamp on the page.

Parameters:

ParameterTypeDescription
valuedoubledouble value

getHeight()

public double getHeight()

Desired height of the stamp on the page.

Returns: double - double value

setHeight(double value)

public void setHeight(double value)

Desired height of the stamp on the page.

Parameters:

ParameterTypeDescription
valuedoubledouble value

getMaxRowWidth()

public double getMaxRowWidth()

Max row height for WordWrap option.

Returns: double - double value

setMaxRowWidth(double value)

public void setMaxRowWidth(double value)

Max row height for WordWrap option.

Parameters:

ParameterTypeDescription
valuedoubledouble value