Watermark

Inheritance: java.lang.Object

public abstract class Watermark

Represents a watermark to be added to a document.

Learn more

Constructors

Constructor Description
Watermark()

Methods

Method Description
getOpacity() Gets or sets the opacity of this [Watermark](../../com.groupdocs.watermark/watermark).
setOpacity(double value) Gets or sets the opacity of this [Watermark](../../com.groupdocs.watermark/watermark).
getY() Gets the y-coordinate of this [Watermark](../../com.groupdocs.watermark/watermark).
setY(double value) Sets the y-coordinate of this [Watermark](../../com.groupdocs.watermark/watermark).
getX() Gets the x-coordinate of this [Watermark](../../com.groupdocs.watermark/watermark).
setX(double value) Sets the x-coordinate of this [Watermark](../../com.groupdocs.watermark/watermark).
getVerticalAlignment() Gets the vertical alignment of this [Watermark](../../com.groupdocs.watermark/watermark).
setVerticalAlignment(int value) Sets the vertical alignment of this [Watermark](../../com.groupdocs.watermark/watermark).
getHorizontalAlignment() Gets the horizontal alignment of this [Watermark](../../com.groupdocs.watermark/watermark).
setHorizontalAlignment(int value) Sets the horizontal alignment of this [Watermark](../../com.groupdocs.watermark/watermark).
getRotateAngle() Gets the rotate angle of this [Watermark](../../com.groupdocs.watermark/watermark) in degrees.
setRotateAngle(double value) Sets the rotate angle of this [Watermark](../../com.groupdocs.watermark/watermark) in degrees.
isBackground() Gets a value indicating whether the watermark should be placed at background.
setBackground(boolean value) Sets a value indicating whether the watermark should be placed at background.
getMargins() Gets the margin settings of this [Watermark](../../com.groupdocs.watermark/watermark).
setMargins(Margins value) Sets the margin settings of this [Watermark](../../com.groupdocs.watermark/watermark).
getHeight() Gets the desired height of this [Watermark](../../com.groupdocs.watermark/watermark).
setHeight(double value) Sets the desired height of this [Watermark](../../com.groupdocs.watermark/watermark).
getWidth() Gets the desired width of this [Watermark](../../com.groupdocs.watermark/watermark).
setWidth(double value) Sets the desired width of this [Watermark](../../com.groupdocs.watermark/watermark).
getScaleFactor() Gets a value that defines how watermark size depends on parent size.
setScaleFactor(double value) Sets a value that defines how watermark size depends on parent size.
getSizingType() Gets a value specifying a way watermark should be sized.
setSizingType(int value) Sets a value specifying a way watermark should be sized.
getConsiderParentMargins() Gets a value indicating whether the watermark size and coordinates are calculated considering parent margins.
setConsiderParentMargins(boolean value) Sets a value indicating whether the watermark size and coordinates are calculated considering parent margins.
isImageWatermark()
isTextWatermark()
getTransparency()
getSize()
copyPropertiesValues(Watermark source, Watermark destination)
deepClone()
hasSameValues(Watermark watermark)
createGeometry(ContentPartGeometry parent)

Watermark()

public Watermark()

getOpacity()

public final double getOpacity()

Gets or sets the opacity of this [Watermark](../../com.groupdocs.watermark/watermark).

The value of opacity should be between 0 and 1. The default value is 1.

Returns: double - The opacity of this [Watermark](../../com.groupdocs.watermark/watermark).

setOpacity(double value)

public final void setOpacity(double value)

Gets or sets the opacity of this [Watermark](../../com.groupdocs.watermark/watermark).

The value of opacity should be between 0 and 1. The default value is 1.

Parameters:

Parameter Type Description
value double The opacity of this [Watermark](../../com.groupdocs.watermark/watermark).

getY()

public final double getY()

Gets the y-coordinate of this [Watermark](../../com.groupdocs.watermark/watermark).

Returns: double - The y-coordinate of this [Watermark](../../com.groupdocs.watermark/watermark).

setY(double value)

public final void setY(double value)

Sets the y-coordinate of this [Watermark](../../com.groupdocs.watermark/watermark).

Parameters:

Parameter Type Description
value double The y-coordinate of this [Watermark](../../com.groupdocs.watermark/watermark).

getX()

public final double getX()

Gets the x-coordinate of this [Watermark](../../com.groupdocs.watermark/watermark).

Returns: double - The x-coordinate of this [Watermark](../../com.groupdocs.watermark/watermark).

setX(double value)

public final void setX(double value)

Sets the x-coordinate of this [Watermark](../../com.groupdocs.watermark/watermark).

Parameters:

Parameter Type Description
value double The x-coordinate of this [Watermark](../../com.groupdocs.watermark/watermark).

getVerticalAlignment()

public final int getVerticalAlignment()

Gets the vertical alignment of this [Watermark](../../com.groupdocs.watermark/watermark).

Default value is [VerticalAlignment.None](../../com.groupdocs.watermark.common/verticalalignment#None).

Returns: int - The [VerticalAlignment](../../com.groupdocs.watermark.common/verticalalignment) of this [Watermark](../../com.groupdocs.watermark/watermark).

setVerticalAlignment(int value)

public final void setVerticalAlignment(int value)

Sets the vertical alignment of this [Watermark](../../com.groupdocs.watermark/watermark).

Default value is [VerticalAlignment.None](../../com.groupdocs.watermark.common/verticalalignment#None).

Parameters:

Parameter Type Description
value int The [VerticalAlignment](../../com.groupdocs.watermark.common/verticalalignment) of this [Watermark](../../com.groupdocs.watermark/watermark).

getHorizontalAlignment()

public final int getHorizontalAlignment()

Gets the horizontal alignment of this [Watermark](../../com.groupdocs.watermark/watermark).

Default value is [HorizontalAlignment.None](../../com.groupdocs.watermark.common/horizontalalignment#None).

Returns: int - The [HorizontalAlignment](../../com.groupdocs.watermark.common/horizontalalignment) of this [Watermark](../../com.groupdocs.watermark/watermark).

setHorizontalAlignment(int value)

public final void setHorizontalAlignment(int value)

Sets the horizontal alignment of this [Watermark](../../com.groupdocs.watermark/watermark).

Default value is [HorizontalAlignment.None](../../com.groupdocs.watermark.common/horizontalalignment#None).

Parameters:

Parameter Type Description
value int The [HorizontalAlignment](../../com.groupdocs.watermark.common/horizontalalignment) of this [Watermark](../../com.groupdocs.watermark/watermark).

getRotateAngle()

public final double getRotateAngle()

Gets the rotate angle of this [Watermark](../../com.groupdocs.watermark/watermark) in degrees.

Returns: double - The rotate angle of this [Watermark](../../com.groupdocs.watermark/watermark) in degrees.

setRotateAngle(double value)

public final void setRotateAngle(double value)

Sets the rotate angle of this [Watermark](../../com.groupdocs.watermark/watermark) in degrees.

Parameters:

Parameter Type Description
value double The rotate angle of this [Watermark](../../com.groupdocs.watermark/watermark) in degrees.

isBackground()

public final boolean isBackground()

Gets a value indicating whether the watermark should be placed at background.

Returns: boolean - If the value is true, the watermark will be placed at the bottom. By default, the value is false, the watermark will be placed at the top.

setBackground(boolean value)

public final void setBackground(boolean value)

Sets a value indicating whether the watermark should be placed at background.

Parameters:

Parameter Type Description
value boolean If the value is true, the watermark will be placed at the bottom. By default, the value is false, the watermark will be placed at the top.

getMargins()

public final Margins getMargins()

Gets the margin settings of this [Watermark](../../com.groupdocs.watermark/watermark).

Returns: Margins - The margin settings of this [Watermark](../../com.groupdocs.watermark/watermark).

setMargins(Margins value)

public final void setMargins(Margins value)

Sets the margin settings of this [Watermark](../../com.groupdocs.watermark/watermark).

Parameters:

Parameter Type Description
value Margins The margin settings of this [Watermark](../../com.groupdocs.watermark/watermark).

getHeight()

public final double getHeight()

Gets the desired height of this [Watermark](../../com.groupdocs.watermark/watermark).

Returns: double - The desired height of this [Watermark](../../com.groupdocs.watermark/watermark).

setHeight(double value)

public final void setHeight(double value)

Sets the desired height of this [Watermark](../../com.groupdocs.watermark/watermark).

Setting this property will also change the value of #getSizingType().getSizingType() property to [SizingType.Absolute](../../com.groupdocs.watermark.watermarks/sizingtype#Absolute).

Parameters:

Parameter Type Description
value double The desired height of this [Watermark](../../com.groupdocs.watermark/watermark).

getWidth()

public final double getWidth()

Gets the desired width of this [Watermark](../../com.groupdocs.watermark/watermark).

Returns: double - The desired width of this [Watermark](../../com.groupdocs.watermark/watermark).

setWidth(double value)

public final void setWidth(double value)

Sets the desired width of this [Watermark](../../com.groupdocs.watermark/watermark).

Setting this property will also change the value of #getSizingType().getSizingType() property to [SizingType.Absolute](../../com.groupdocs.watermark.watermarks/sizingtype#Absolute).

Parameters:

Parameter Type Description
value double The desired width of this [Watermark](../../com.groupdocs.watermark/watermark).

getScaleFactor()

public final double getScaleFactor()

Gets a value that defines how watermark size depends on parent size.

The value must be between 0 and 1.

Returns: double - The scale factor of this [Watermark](../../com.groupdocs.watermark/watermark).

setScaleFactor(double value)

public final void setScaleFactor(double value)

Sets a value that defines how watermark size depends on parent size.

The value must be between 0 and 1.

Parameters:

Parameter Type Description
value double The scale factor of this [Watermark](../../com.groupdocs.watermark/watermark).

getSizingType()

public final int getSizingType()

Gets a value specifying a way watermark should be sized.

Returns: int - The sizing type.

setSizingType(int value)

public final void setSizingType(int value)

Sets a value specifying a way watermark should be sized.

Parameters:

Parameter Type Description
value int The sizing type.

getConsiderParentMargins()

public final boolean getConsiderParentMargins()

Gets a value indicating whether the watermark size and coordinates are calculated considering parent margins.

Returns: boolean - If the value is true, watermark size and coordinates are calculated considering parent margins. By default, the value is false, parent margins are ignored.

setConsiderParentMargins(boolean value)

public final void setConsiderParentMargins(boolean value)

Sets a value indicating whether the watermark size and coordinates are calculated considering parent margins.

Parameters:

Parameter Type Description
value boolean If the value is true, watermark size and coordinates are calculated considering parent margins. By default, the value is false, parent margins are ignored.

isImageWatermark()

public abstract boolean isImageWatermark()

Returns: boolean

isTextWatermark()

public abstract boolean isTextWatermark()

Returns: boolean

getTransparency()

public final double getTransparency()

Returns: double

getSize()

public abstract SizeD getSize()

Returns: com.groupdocs.watermark.internal.SizeD

copyPropertiesValues(Watermark source, Watermark destination)

public static void copyPropertiesValues(Watermark source, Watermark destination)

Parameters:

Parameter Type Description
source Watermark
destination Watermark

deepClone()

public abstract Watermark deepClone()

Returns: Watermark

hasSameValues(Watermark watermark)

public boolean hasSameValues(Watermark watermark)

Parameters:

Parameter Type Description
watermark Watermark

Returns: boolean

createGeometry(ContentPartGeometry parent)

public abstract WatermarkGeometry createGeometry(ContentPartGeometry parent)

Parameters:

Parameter Type Description
parent com.groupdocs.watermark.internal.ContentPartGeometry

Returns: com.groupdocs.watermark.internal.WatermarkGeometry