com.aspose.words

Class WatermarkType

  • java.lang.Object
    • com.aspose.words.WatermarkType
public class WatermarkType 
extends java.lang.Object

Utility class containing constants. Specifies the watermark type.

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();

Field Summary
static final intTEXT = 0
Indicates that the text will be used as a watermark.

Such a watermark corresponds to a WordArt object.

static final intIMAGE = 1
Indicates that the image will be used as a watermark.

Such a watermark corresponds to a shape with image.

static final intNONE = 2
Indicates watermark is no set.
 

    • Field Detail

      • TEXT = 0

        public static final int TEXT
        Indicates that the text will be used as a watermark.

        Such a watermark corresponds to a WordArt object.

      • IMAGE = 1

        public static final int IMAGE
        Indicates that the image will be used as a watermark.

        Such a watermark corresponds to a shape with image.

      • NONE = 2

        public static final int NONE
        Indicates watermark is no set.