@Deprecated public class TextWatermark extends Watermark
Represents a text watermark.
This example demonstrates how to add text watermark to a document of any supported format.
Document document = Document.load("D:\\input.doc"); // Create TextWatermark instance. TextWatermark watermark = new TextWatermark("Test watermark", new Font("Arial", 42)); // Add watermark to the document. document.addWatermark(watermark); document.save("D:\\output.doc"); document.close();
Constructor and Description |
---|
TextWatermark(String text,
Font font)
Deprecated.
Initializes a new instance of the
TextWatermark class. |
Modifier and Type | Method and Description |
---|---|
Color |
getBackgroundColor()
Deprecated.
Gets the background color of the text.
|
Font |
getFont()
Deprecated.
Gets the font of the text.
|
Color |
getForegroundColor()
Deprecated.
Gets the foreground color of the text.
|
String |
getText()
Deprecated.
Gets the text to be used as watermark.
|
int |
getTextAlignment()
Deprecated.
Gets the watermark text alignment.
|
void |
setBackgroundColor(Color value)
Deprecated.
Sets the background color of the text.
|
void |
setFont(Font value)
Deprecated.
Sets the font of the text.
|
void |
setForegroundColor(Color value)
Deprecated.
Sets the foreground color of the text.
|
void |
setText(String value)
Deprecated.
Sets the text to be used as watermark.
|
void |
setTextAlignment(int value)
Deprecated.
Sets the watermark text alignment.
|
getConsiderParentMargins, getHeight, getHorizontalAlignment, getMargins, getOpacity, getRotateAngle, getScaleFactor, getSizingType, getVerticalAlignment, getWidth, getX, getY, isBackground, setBackground, setConsiderParentMargins, setHeight, setHorizontalAlignment, setMargins, setOpacity, setRotateAngle, setScaleFactor, setSizingType, setVerticalAlignment, setWidth, setX, setY
public final String getText()
Gets the text to be used as watermark.
public final void setText(String value)
Sets the text to be used as watermark.
value
- The string representing watermark text.public final Font getFont()
Gets the font of the text.
public final void setFont(Font value)
Sets the font of the text.
value
- The font of the text.public final Color getForegroundColor()
Gets the foreground color of the text.
public final void setForegroundColor(Color value)
Sets the foreground color of the text.
value
- The foreground color of the text.public final Color getBackgroundColor()
Gets the background color of the text.
public final void setBackgroundColor(Color value)
Sets the background color of the text.
value
- The background color of the text.public final int getTextAlignment()
Gets the watermark text alignment.
F:TextAlignment.Left
.public final void setTextAlignment(int value)
Sets the watermark text alignment.
value
- The watermark text alignment. Default value is F:TextAlignment.Left
.