java.lang.Objectcom.aspose.words.ImageWatermarkOptions
public class ImageWatermarkOptions
Constructor Summary |
---|
ImageWatermarkOptions()
|
Property Getters/Setters Summary | ||
---|---|---|
boolean | isWashout() | |
void | isWashout(boolean value) | |
Gets or sets a boolean value which is responsible for washout effect of the watermark. The default value is True. | ||
double | getScale() | |
void | setScale(double value) | |
Gets or sets the scale factor expressed as a fraction of the image. The default value is 0 - auto. |
Constructor Detail |
---|
public ImageWatermarkOptions()
Property Getters/Setters Detail |
---|
isWashout/isWashout | |
public boolean isWashout() / public void isWashout(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();
getScale/setScale | |
public double getScale() / public void setScale(double value) |
Valid values range from 0 to 65.5 inclusive.
Auto scale 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();