TextStamp
Inheritance: java.lang.Object, com.aspose.pdf.Stamp
public class TextStamp extends Stamp
Reresents textual stamp.
Constructors
Constructor | Description |
---|---|
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
Method | Description |
---|---|
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:
Parameter | Type | Description |
---|---|---|
value | java.lang.String | Stamp value. |
TextStamp(String value, TextState textState)
public TextStamp(String value, TextState textState)
Initializes a new instance of the TextStamp class.
Parameters:
Parameter | Type | Description |
---|---|---|
value | java.lang.String | Stamp value. |
textState | TextState | Stamp text state. |
TextStamp(FormattedText formattedText)
public TextStamp(FormattedText formattedText)
Initializes a new instance of the TextStamp class with formattedText object
Parameters:
Parameter | Type | Description |
---|---|---|
formattedText | FormattedText | FormattedText 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:
Parameter | Type | Description |
---|---|---|
value | boolean | boolean 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:
Parameter | Type | Description |
---|---|---|
value | boolean | boolean 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:
Parameter | Type | Description |
---|---|---|
value | boolean | boolean 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:
Parameter | Type | Description |
---|---|---|
value | boolean | 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 - 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:
Parameter | Type | Description |
---|---|---|
value | boolean | boolean 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:
Parameter | Type | Description |
---|---|---|
value | java.lang.String | String 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:
Parameter | Type | Description |
---|---|---|
value | HorizontalAlignment | HorizontalAlignment value |
put(Page page)
public void put(Page page)
Adds textual stamp on the page.
Parameters:
Parameter | Type | Description |
---|---|---|
page | Page | Page 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:
Parameter | Type | Description |
---|---|---|
value | double | double 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:
Parameter | Type | Description |
---|---|---|
value | double | double 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:
Parameter | Type | Description |
---|---|---|
value | double | double value |