java.lang.Objectcom.aspose.words.TextWatermarkOptions
public class TextWatermarkOptions
Constructor Summary |
---|
TextWatermarkOptions()
|
Property Getters/Setters Summary | ||
---|---|---|
java.awt.Color | getColor() | |
void | setColor(java.awt.Color value) | |
Gets or sets font color. The default value is Color.Silver. | ||
java.lang.String | getFontFamily() | |
void | setFontFamily(java.lang.String value) | |
Gets or sets font family name. The default value is "Calibri". | ||
float | getFontSize() | |
void | setFontSize(float value) | |
Gets or sets a font size. The default value is 0 - auto. | ||
boolean | isSemitrasparent() | |
void | isSemitrasparent(boolean value) | |
Gets or sets a boolean value which is responsible for opacity of the watermark. The default value is True. | ||
int | getLayout() | |
void | setLayout(int value) | |
Gets or sets layout of the watermark. The default value is |
Constructor Detail |
---|
public TextWatermarkOptions()
Property Getters/Setters Detail |
---|
getColor/setColor | |
public java.awt.Color getColor() / public void setColor(java.awt.Color value) |
Example:
Shows how to create and remove watermarks in the document.Document doc = new Document(); doc.getWatermark().setText("Aspose Watermark"); TextWatermarkOptions textWatermarkOptions = new TextWatermarkOptions(); textWatermarkOptions.setFontFamily("Arial"); textWatermarkOptions.setFontSize(36f); textWatermarkOptions.setColor(Color.BLACK); textWatermarkOptions.setLayout(WatermarkLayout.HORIZONTAL); textWatermarkOptions.isSemitrasparent(false); doc.getWatermark().setText("Aspose Watermark", textWatermarkOptions); ImageWatermarkOptions imageWatermarkOptions = new ImageWatermarkOptions(); imageWatermarkOptions.setScale(5.0); imageWatermarkOptions.isWashout(false); doc.getWatermark().setImage(ImageIO.read(new File(getImageDir() + "Logo.jpg")), imageWatermarkOptions); if (doc.getWatermark().getType() == WatermarkType.TEXT) doc.getWatermark().remove();
getFontFamily/setFontFamily | |
public java.lang.String getFontFamily() / public void setFontFamily(java.lang.String value) |
Example:
Shows how to create and remove watermarks in the document.Document doc = new Document(); doc.getWatermark().setText("Aspose Watermark"); TextWatermarkOptions textWatermarkOptions = new TextWatermarkOptions(); textWatermarkOptions.setFontFamily("Arial"); textWatermarkOptions.setFontSize(36f); textWatermarkOptions.setColor(Color.BLACK); textWatermarkOptions.setLayout(WatermarkLayout.HORIZONTAL); textWatermarkOptions.isSemitrasparent(false); doc.getWatermark().setText("Aspose Watermark", textWatermarkOptions); ImageWatermarkOptions imageWatermarkOptions = new ImageWatermarkOptions(); imageWatermarkOptions.setScale(5.0); imageWatermarkOptions.isWashout(false); doc.getWatermark().setImage(ImageIO.read(new File(getImageDir() + "Logo.jpg")), imageWatermarkOptions); if (doc.getWatermark().getType() == WatermarkType.TEXT) doc.getWatermark().remove();
getFontSize/setFontSize | |
public float getFontSize() / public void setFontSize(float value) |
Valid values range from 0 to 65.5 inclusive.
Auto font size means that the watermark will be scaled to its max width and max height relative to the page margins.
Example:
Shows how to create and remove watermarks in the document.Document doc = new Document(); doc.getWatermark().setText("Aspose Watermark"); TextWatermarkOptions textWatermarkOptions = new TextWatermarkOptions(); textWatermarkOptions.setFontFamily("Arial"); textWatermarkOptions.setFontSize(36f); textWatermarkOptions.setColor(Color.BLACK); textWatermarkOptions.setLayout(WatermarkLayout.HORIZONTAL); textWatermarkOptions.isSemitrasparent(false); doc.getWatermark().setText("Aspose Watermark", textWatermarkOptions); ImageWatermarkOptions imageWatermarkOptions = new ImageWatermarkOptions(); imageWatermarkOptions.setScale(5.0); imageWatermarkOptions.isWashout(false); doc.getWatermark().setImage(ImageIO.read(new File(getImageDir() + "Logo.jpg")), imageWatermarkOptions); if (doc.getWatermark().getType() == WatermarkType.TEXT) doc.getWatermark().remove();
isSemitrasparent/isSemitrasparent | |
public boolean isSemitrasparent() / public void isSemitrasparent(boolean value) |
Example:
Shows how to create and remove watermarks in the document.Document doc = new Document(); doc.getWatermark().setText("Aspose Watermark"); TextWatermarkOptions textWatermarkOptions = new TextWatermarkOptions(); textWatermarkOptions.setFontFamily("Arial"); textWatermarkOptions.setFontSize(36f); textWatermarkOptions.setColor(Color.BLACK); textWatermarkOptions.setLayout(WatermarkLayout.HORIZONTAL); textWatermarkOptions.isSemitrasparent(false); doc.getWatermark().setText("Aspose Watermark", textWatermarkOptions); ImageWatermarkOptions imageWatermarkOptions = new ImageWatermarkOptions(); imageWatermarkOptions.setScale(5.0); imageWatermarkOptions.isWashout(false); doc.getWatermark().setImage(ImageIO.read(new File(getImageDir() + "Logo.jpg")), imageWatermarkOptions); if (doc.getWatermark().getType() == WatermarkType.TEXT) doc.getWatermark().remove();
getLayout/setLayout | |
public int getLayout() / public void setLayout(int value) |
Example:
Shows how to create and remove watermarks in the document.Document doc = new Document(); doc.getWatermark().setText("Aspose Watermark"); TextWatermarkOptions textWatermarkOptions = new TextWatermarkOptions(); textWatermarkOptions.setFontFamily("Arial"); textWatermarkOptions.setFontSize(36f); textWatermarkOptions.setColor(Color.BLACK); textWatermarkOptions.setLayout(WatermarkLayout.HORIZONTAL); textWatermarkOptions.isSemitrasparent(false); doc.getWatermark().setText("Aspose Watermark", textWatermarkOptions); ImageWatermarkOptions imageWatermarkOptions = new ImageWatermarkOptions(); imageWatermarkOptions.setScale(5.0); imageWatermarkOptions.isWashout(false); doc.getWatermark().setImage(ImageIO.read(new File(getImageDir() + "Logo.jpg")), imageWatermarkOptions); if (doc.getWatermark().getType() == WatermarkType.TEXT) doc.getWatermark().remove();