java.lang.Objectcom.aspose.words.WatermarkType
public class WatermarkType
Example:
Document doc = new Document();
// Add a plain text watermark.
doc.getWatermark().setText("Aspose Watermark");
// If we wish to edit the text formatting using it as a watermark,
// we can do so by passing a TextWatermarkOptions object when creating the watermark.
TextWatermarkOptions textWatermarkOptions = new TextWatermarkOptions();
textWatermarkOptions.setFontFamily("Arial");
textWatermarkOptions.setFontSize(36f);
textWatermarkOptions.setColor(Color.BLACK);
textWatermarkOptions.setLayout(WatermarkLayout.DIAGONAL);
textWatermarkOptions.isSemitrasparent(false);
doc.getWatermark().setText("Aspose Watermark", textWatermarkOptions);
doc.save(getArtifactsDir() + "Document.TextWatermark.docx");
// We can remove a watermark from a document like this.
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 |