WatermarkType

Inheritance: java.lang.Object

public class WatermarkType

Specifies the watermark type.

Examples:

Shows how to create a text watermark.


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

Fields

FieldDescription
IMAGEIndicates that the image will be used as a watermark.
NONEIndicates watermark is no set.
TEXTIndicates that the text will be used as a watermark.
length

Methods

MethodDescription
fromName(String watermarkTypeName)
getName(int watermarkType)
getValues()
toString(int watermarkType)

IMAGE

public static int IMAGE

Indicates that the image will be used as a watermark.

Such a watermark corresponds to a shape with image.

NONE

public static int NONE

Indicates watermark is no set.

TEXT

public static int TEXT

Indicates that the text will be used as a watermark.

Such a watermark corresponds to a WordArt object.

length

public static int length

fromName(String watermarkTypeName)

public static int fromName(String watermarkTypeName)

Parameters:

ParameterTypeDescription
watermarkTypeNamejava.lang.String

Returns: int

getName(int watermarkType)

public static String getName(int watermarkType)

Parameters:

ParameterTypeDescription
watermarkTypeint

Returns: java.lang.String

getValues()

public static int[] getValues()

Returns: int[]

toString(int watermarkType)

public static String toString(int watermarkType)

Parameters:

ParameterTypeDescription
watermarkTypeint

Returns: java.lang.String