TextStamp

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

public class TextStamp extends Stamp

Reresents textual stamp.

Constructors

ConstructorDescription
TextStampInitializes a new instance of the {@code TextStamp} class with formattedText object
TextStampInitializes a new instance of the {@code TextStamp} class with formattedText object
TextStampInitializes a new instance of the {@code TextStamp} class.
TextStampInitializes a new instance of the TextStamp class.

Methods

MethodDescription
getAutoAdjustFontSizePrecisionAutomatically adjust font size precision. Default value: 0.1;
getAutoAdjustFontSizeToFitStampRectangleIf enabled, the font size will be automatically adjusted to fit the stamp rectangle of size: {@code Width}({@code Stamp#getWidth}/{@code Stamp#setWidth(double)}) and {@code Height}({@code Stamp#getHeight}/{@code Stamp#setHeight(double)}). Default width and height are derived from the page rectangle.
getDefaultFontReturns default font
getDefaultFontSizeDefault Font Size
getDrawThis 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.
getFontSizeActual font size after the stamp has been placed. (May differ from the initial font size provided through the constructor if the ‘AutoAdjustFontSizeToFitStampRectangle’ option is enabled.)
getHeightDesired height of the stamp on the page.
getMaxRowWidthMax row height for WordWrap option.
getNoCharacterBehaviorGets or sets mode that defines behavior in case fonts don’t contain requested characters.
getReplacementFontGets or sets font used for replacing if user font does not contain required character.
getTextAlignmentAlignment of the text inside the stamp.
getTextStateGets text properties of the stamp. See {@code TextState} for details.
getTreatYIndentAsBaseLineDefines 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.
getValueGets string value which is used as stamp on the page.
getWidthDesired width of the stamp on the page.
getWordWrapModeGets or sets the word wrap mode for text rendering.
isJustifyDefines text justification. If this property is set to true, both left and right edges of the text are aligned. Default value: false.
isScaleDefines 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.
isWordWrapDefines 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.
putAdds textual stamp on the page.
setAutoAdjustFontSizePrecisionAutomatically adjust font size precision. Default value: 0.1;
setAutoAdjustFontSizeToFitStampRectangleIf enabled, the font size will be automatically adjusted to fit the stamp rectangle of size: {@code Width}({@code Stamp#getWidth}/{@code Stamp#setWidth(double)}) and {@code Height}({@code Stamp#getHeight}/{@code Stamp#setHeight(double)}). Default width and height are derived from the page rectangle.
setDrawThis 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.
setHeightDesired height of the stamp on the page.
setJustifyDefines text justification. If this property is set to true, both left and right edges of the text are aligned. Default value: false.
setMaxRowWidthMax row height for WordWrap option.
setNoCharacterBehaviorGets or sets mode that defines behavior in case fonts don’t contain requested characters.
setReplacementFontGets or sets font used for replacing if user font does not contain required character.
setScaleDefines 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.
setTextAlignmentAlignment of the text inside the stamp.
setTreatYIndentAsBaseLineDefines 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.
setValueSets string value which is used as stamp on the page.
setWidthDesired width of the stamp on the page.
setWordWrapDefines 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.
setWordWrapModeGets or sets the word wrap mode for text rendering.

TextStamp

Initializes a new instance of the {@code TextStamp} class with formattedText object

TextStamp

Initializes a new instance of the {@code TextStamp} class with formattedText object

TextStamp

Initializes a new instance of the {@code TextStamp} class.

TextStamp

Initializes a new instance of the TextStamp class.

getAutoAdjustFontSizePrecision

public final float getAutoAdjustFontSizePrecision()

Automatically adjust font size precision. Default value: 0.1;

Returns: float value

getAutoAdjustFontSizeToFitStampRectangle

public final boolean getAutoAdjustFontSizeToFitStampRectangle()

If enabled, the font size will be automatically adjusted to fit the stamp rectangle of size: {@code Width}({@code Stamp#getWidth}/{@code Stamp#setWidth(double)}) and {@code Height}({@code Stamp#getHeight}/{@code Stamp#setHeight(double)}). Default width and height are derived from the page rectangle.

Returns: boolean value

getDefaultFont

public static Font getDefaultFont()

Returns default font

Returns: com.aspose.pdf.Font object

getDefaultFontSize

public static float getDefaultFontSize()

Default Font Size

Returns: 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 value

getFontSize

public final float getFontSize()

Actual font size after the stamp has been placed. (May differ from the initial font size provided through the constructor if the ‘AutoAdjustFontSizeToFitStampRectangle’ option is enabled.)

Returns: float value

getHeight

public double getHeight()

Desired height of the stamp on the page.

Returns: double value

getMaxRowWidth

public double getMaxRowWidth()

Max row height for WordWrap option.

Returns: double value

getNoCharacterBehavior

public final int getNoCharacterBehavior()

Gets or sets mode that defines behavior in case fonts don’t contain requested characters.

Returns: NoCharacterAction element

getReplacementFont

public final Font getReplacementFont()

Gets or sets font used for replacing if user font does not contain required character.

Returns: Font instance

getTextAlignment

public HorizontalAlignment getTextAlignment()

Alignment of the text inside the stamp.

Returns: HorizontalAlignment value @see HorizontalAlignment

getTextState

public TextState getTextState()

Gets text properties of the stamp. See {@code TextState} for details.

Returns: TextState element

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 value

getValue

public String getValue()

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

Returns: String value

getWidth

public double getWidth()

Desired width of the stamp on the page.

Returns: double value

getWordWrapMode

public final int getWordWrapMode()

Gets or sets the word wrap mode for text rendering.

Returns: WordWrapMode element

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 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 value

isWordWrap

@Deprecated 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 value @deprecated “Use WordWrapMode instead.”

put

Adds textual stamp on the page.

setAutoAdjustFontSizePrecision

public final void setAutoAdjustFontSizePrecision(float value)

Automatically adjust font size precision. Default value: 0.1;

Parameters:

ParameterTypeDescription
valuefloat value

setAutoAdjustFontSizeToFitStampRectangle

public final void setAutoAdjustFontSizeToFitStampRectangle(boolean value)

If enabled, the font size will be automatically adjusted to fit the stamp rectangle of size: {@code Width}({@code Stamp#getWidth}/{@code Stamp#setWidth(double)}) and {@code Height}({@code Stamp#getHeight}/{@code Stamp#setHeight(double)}). Default width and height are derived from the page rectangle.

Parameters:

ParameterTypeDescription
valueboolean value

setDraw

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
valueboolean value

setHeight

public void setHeight(double value)

Desired height of the stamp on the page.

Parameters:

ParameterTypeDescription
valuedouble value

setJustify

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
valueboolean value

setMaxRowWidth

public void setMaxRowWidth(double value)

Max row height for WordWrap option.

Parameters:

ParameterTypeDescription
valuedouble value

setNoCharacterBehavior

public final void setNoCharacterBehavior(int value)

Gets or sets mode that defines behavior in case fonts don’t contain requested characters.

Parameters:

ParameterTypeDescription
valueNoCharacterAction element

setReplacementFont

Gets or sets font used for replacing if user font does not contain required character.

setScale

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
valueboolean value

setTextAlignment

Alignment of the text inside the stamp.

setTreatYIndentAsBaseLine

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
valueboolean value

setValue

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

setWidth

public void setWidth(double value)

Desired width of the stamp on the page.

Parameters:

ParameterTypeDescription
valuedouble value

setWordWrap

@Deprecated 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
valueboolean value @deprecated “Use WordWrapMode instead.”

setWordWrapMode

public final void setWordWrapMode(int value)

Gets or sets the word wrap mode for text rendering.

Parameters:

ParameterTypeDescription
valueWordWrapMode element @see WordWrapMode