Package com.dynamicpdf.api.elements
Class TextElement
java.lang.Object
com.dynamicpdf.api.elements.Element
com.dynamicpdf.api.elements.TextElement
Represents a text element.
This class can be used to place text on a page.
-
Constructor Summary
ConstructorDescriptionTextElement(String value, ElementPlacement placement)
Initializes a new instance of theTextElement
classTextElement(String value, ElementPlacement placement, float xOffset, float yOffset)
Initializes a new instance of theTextElement
class -
Method Summary
Modifier and TypeMethodDescriptiongetColor()
Gets theColor
object to use for the text of the text element.getFont()
Gets theFont
object used to specify the font of the text for the text element.float
Gets the font size for the text of the text element.getText()
Gets the text to display in the text element.void
Sets theColor
object to use for the text of the text element.void
Sets theFont
object used to specify the font of the text for the text element.void
setFontSize(float value)
Sets the font size for the text of the text element.void
Sets the text to display in the text element.Methods inherited from class com.dynamicpdf.api.elements.Element
getEvenPages, getOddPages, getPlacement, getXOffset, getYOffset, setEvenPages, setOddPages, setPlacement, setXOffset, setYOffset
-
Constructor Details
-
TextElement
Initializes a new instance of theTextElement
class- Parameters:
value
- Text to display in the text element.placement
- The placement of the text element on the page.xOffset
- X coordinate of the text element.yOffset
- Y coordinate of the text element.
-
TextElement
Initializes a new instance of theTextElement
class- Parameters:
value
- Text to display in the text element.placement
- The placement of the text element on the page.
-
-
Method Details
-
getResource
- Overrides:
getResource
in classElement
-
getTextFont
- Overrides:
getTextFont
in classElement
-
getText
Gets the text to display in the text element.- Returns:
- The text to display in the text element.
-
setText
Sets the text to display in the text element.- Parameters:
value
- The text to display in the text element.
-
getColor
Gets theColor
object to use for the text of the text element.- Returns:
- The
Color
object to use for the text of the text element.
-
setColor
Sets theColor
object to use for the text of the text element.- Parameters:
value
- TheColor
object to use for the text of the text element.
-
getFont
Gets theFont
object used to specify the font of the text for the text element.- Returns:
- The
Font
object used to specify the font of the text for the text element.
-
setFont
Sets theFont
object used to specify the font of the text for the text element.- Parameters:
value
- TheFont
object used to specify the font of the text for the text element.
-
getFontSize
public float getFontSize()Gets the font size for the text of the text element.- Returns:
- The font size for the text of the text element.
-
setFontSize
public void setFontSize(float value)Sets the font size for the text of the text element.- Parameters:
value
- The font size for the text of the text element.
-