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
| Constructor | Description |
|---|---|
| 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. |
Methods
| Method | Description |
|---|---|
| getAutoAdjustFontSizePrecision | Automatically adjust font size precision. Default value: 0.1; |
| 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. |
| getDefaultFont | Returns default font |
| getDefaultFontSize | Default Font Size |
| 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. |
| 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.) |
| getHeight | Desired height of the stamp on the page. |
| getMaxRowWidth | Max row height for WordWrap option. |
| getNoCharacterBehavior | Gets or sets mode that defines behavior in case fonts don’t contain requested characters. |
| getReplacementFont | Gets or sets font used for replacing if user font does not contain required character. |
| getTextAlignment | Alignment of the text inside the stamp. |
| getTextState | Gets text properties of the stamp. See {@code TextState} for details. |
| 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. |
| getValue | Gets string value which is used as stamp on the page. |
| getWidth | Desired width of the stamp on the page. |
| getWordWrapMode | Gets or sets the word wrap mode for text rendering. |
| isJustify | Defines text justification. If this property is set to true, both left and right edges of the text are aligned. Default value: false. |
| 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. |
| 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. |
| put | Adds textual stamp on the page. |
| setAutoAdjustFontSizePrecision | Automatically adjust font size precision. Default value: 0.1; |
| setAutoAdjustFontSizeToFitStampRectangle | 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. |
| setDraw | 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. |
| setHeight | Desired height of the stamp on the page. |
| setJustify | Defines text justification. If this property is set to true, both left and right edges of the text are aligned. Default value: false. |
| setMaxRowWidth | Max row height for WordWrap option. |
| setNoCharacterBehavior | Gets or sets mode that defines behavior in case fonts don’t contain requested characters. |
| setReplacementFont | Gets or sets font used for replacing if user font does not contain required character. |
| setScale | 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. |
| setTextAlignment | Alignment of the text inside the stamp. |
| setTreatYIndentAsBaseLine | 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. |
| setValue | Sets string value which is used as stamp on the page. |
| setWidth | Desired width of the stamp on the page. |
| setWordWrap | 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. |
| setWordWrapMode | Gets 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:
| Parameter | Type | Description |
|---|---|---|
| value | float 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:
| Parameter | Type | Description |
|---|---|---|
| value | boolean 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:
| Parameter | Type | Description |
|---|---|---|
| value | boolean value |
setHeight
public void setHeight(double value)
Desired height of the stamp on the page.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| value | double 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:
| Parameter | Type | Description |
|---|---|---|
| value | boolean value |
setMaxRowWidth
public void setMaxRowWidth(double value)
Max row height for WordWrap option.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| value | double value |
setNoCharacterBehavior
public final void setNoCharacterBehavior(int value)
Gets or sets mode that defines behavior in case fonts don’t contain requested characters.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| value | NoCharacterAction 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:
| Parameter | Type | Description |
|---|---|---|
| value | boolean 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:
| Parameter | Type | Description |
|---|---|---|
| value | boolean 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:
| Parameter | Type | Description |
|---|---|---|
| value | double 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:
| Parameter | Type | Description |
|---|---|---|
| value | boolean value @deprecated “Use WordWrapMode instead.” |
setWordWrapMode
public final void setWordWrapMode(int value)
Gets or sets the word wrap mode for text rendering.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| value | WordWrapMode element @see WordWrapMode |