java.lang.Objectcom.aspose.words.WatermarkType
public class WatermarkType
Example:
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();
Field Summary | ||
---|---|---|
static final int | TEXT | |
Indicates that the text will be used as a watermark.
Such a watermark corresponds to a WordArt object. |
||
static final int | IMAGE | |
Indicates that the image will be used as a watermark.
Such a watermark corresponds to a shape with image. |
||
static final int | NONE | |
Indicates watermark is no set. |
Field Detail |
---|
TEXT = 0 | |
public static final int TEXT |
Such a watermark corresponds to a WordArt object.
IMAGE = 1 | |
public static final int IMAGE |
Such a watermark corresponds to a shape with image.
NONE = 2 | |
public static final int NONE |