Package com.ironsoftware.ironpdf.stamp
Class TextStamper
- java.lang.Object
-
- com.ironsoftware.ironpdf.stamp.Stamper
-
- com.ironsoftware.ironpdf.stamp.TextStamper
-
public class TextStamper extends Stamper
This allows the user to edit an existing PDF by adding some stamped text. A subclass ofStamper
. Defines a Text PDF Stamper. Can be applied with:PdfDocument.applyStamp(Stamper, PageSelection)
-
-
Constructor Summary
Constructors Constructor Description TextStamper()
Instantiates a new Text stamper.TextStamper(String text)
Instantiates a new Text stamper.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getBackgroundColorCode()
Gets Background Color.String
getFontColorCode()
Gets Font Color.String
getFontFamily()
Gets font family.int
getFontSize()
Gets font size.String
getText()
Gets text to be stamped by the Stamperboolean
isBold()
Is bold boolean.boolean
isItalic()
Is italic boolean.boolean
isStrikethrough()
Is strikethrough boolean.boolean
isUnderline()
Is underline boolean.boolean
isUseGoogleFont()
Is use google font boolean.void
setBackgroundColorCode(String value)
Sets Background Color.void
setBold(boolean value)
Sets bold.void
setFontColor(String value)
Sets Font Color.void
setFontFamily(String value)
Sets font family.void
setFontSize(int value)
Sets font size.void
setItalic(boolean value)
Sets italic.void
setStrikethrough(boolean value)
Sets strikethrough.void
setText(String value)
Sets text to be stamped by the Stampervoid
setUnderline(boolean value)
Sets underline.void
setUseGoogleFont(boolean value)
Sets use google font.-
Methods inherited from class com.ironsoftware.ironpdf.stamp.Stamper
getHorizontalAlignment, getHorizontalOffset, getHtml, getHyperlink, getMaxHeight, getMaxWidth, getMinHeight, getMinWidth, getOpacity, getRotation, getScale, getVerticalAlignment, getVerticalOffset, getWaitFor, isStampBehindContent, setHorizontalAlignment, setHorizontalOffset, setHtml, setHyperlink, setMaxHeight, setMaxWidth, setMinHeight, setMinWidth, setOpacity, setRotation, setScale, setStampBehindContent, setVerticalAlignment, setVerticalOffset, setWaitFor
-
-
-
-
Constructor Detail
-
TextStamper
public TextStamper()
Instantiates a new Text stamper. This allows the user to edit an existing PDF by adding some stamped text. A subclass ofStamper
. Defines a Text PDF Stamper. Can be applied with:PdfDocument.applyStamp(Stamper, PageSelection)
-
TextStamper
public TextStamper(String text)
Instantiates a new Text stamper. This allows the user to edit an existing PDF by adding some stamped text. A subclass ofStamper
. Defines a Text PDF Stamper. Can be applied with:PdfDocument.applyStamp(Stamper, PageSelection)
- Parameters:
text
- the text to be stamped by the Stamper
-
-
Method Detail
-
getText
public final String getText()
Gets text to be stamped by the Stamper- Returns:
- the text
-
setText
public final void setText(String value)
Sets text to be stamped by the Stamper- Parameters:
value
- the value
-
isBold
public final boolean isBold()
Is bold boolean. Determines if the bold font weight is applied.- Returns:
- the boolean
-
setBold
public final void setBold(boolean value)
Sets bold. Determines if the bold font weight is applied.- Parameters:
value
- the value
-
isItalic
public final boolean isItalic()
Is italic boolean. Determines if the text has the italic font style applied.- Returns:
- the boolean
-
setItalic
public final void setItalic(boolean value)
Sets italic. Determines if the text has the italic font style applied.- Parameters:
value
- the value
-
isUnderline
public final boolean isUnderline()
Is underline boolean. Determines if the text has an underline font style applied.- Returns:
- the boolean
-
setUnderline
public final void setUnderline(boolean value)
Sets underline. Determines if the text has an underline font style applied.- Parameters:
value
- the value
-
isStrikethrough
public final boolean isStrikethrough()
Is strikethrough boolean. Determines if the text has a strike-through applied.- Returns:
- the boolean
-
setStrikethrough
public final void setStrikethrough(boolean value)
Sets strikethrough. Determines if the text has a strike-through applied.- Parameters:
value
- the value
-
getFontSize
public final int getFontSize()
Gets font size. Font size in px.- Returns:
- the font size
-
setFontSize
public final void setFontSize(int value)
Sets font size. Font size in px.- Parameters:
value
- the value
-
getFontFamily
public final String getFontFamily()
Gets font family. Font family name for the text. Note: If using a web font from font.google then you must setsetUseGoogleFont(boolean)
property of this TextStamper to true.- Returns:
- the font family
-
setFontFamily
public final void setFontFamily(String value)
Sets font family. Font family name for the text. Note: If using a web font from font.google then you must setsetUseGoogleFont(boolean)
property of this TextStamper to true.- Parameters:
value
- the value
-
isUseGoogleFont
public final boolean isUseGoogleFont()
Is use google font boolean. Working withsetFontFamily(String)
- Returns:
- the boolean
-
setUseGoogleFont
public final void setUseGoogleFont(boolean value)
Sets use google font.setFontFamily(String)
- Parameters:
value
- the value
-
getFontColorCode
public final String getFontColorCode()
Gets Font Color. Default is '#000000' (Black).- Returns:
- the font color
-
setFontColor
public final void setFontColor(String value)
Sets Font Color. Default is '#000000' (Black).- Parameters:
value
- font color
-
getBackgroundColorCode
public final String getBackgroundColorCode()
Gets Background Color. Default is '#00FFFFFF' (Transparent).- Returns:
- the font color
-
setBackgroundColorCode
public final void setBackgroundColorCode(String value)
Sets Background Color. Default is '#00FFFFFF' (Transparent).- Parameters:
value
- font color
-
-