Margins

Inheritance: java.lang.Object

public class Margins

Represents margin settings for each edge of an object.

Constructors

Constructor Description
Margins() Initializes a new instance of the [Margins](../../com.groupdocs.watermark.watermarks/margins) class.
Margins(int marginType, double left, double right, double top, double bottom) Initializes a new instance of the [Margins](../../com.groupdocs.watermark.watermarks/margins) class with the specified type, location and size.

Methods

Method Description
getMarginType() Gets [MarginType](../../com.groupdocs.watermark.watermarks/margintype).
setMarginType(int value) Sets [MarginType](../../com.groupdocs.watermark.watermarks/margintype).
getLeft() Gets the left margin.
setLeft(double value) Sets the left margin.
getRight() Gets the right margin.
setRight(double value) Sets the right margin.
getTop() Gets the top margin.
setTop(double value) Sets the top margin.
getBottom() Gets the bottom margin.
setBottom(double value) Sets the bottom margin.

Margins()

public Margins()

Initializes a new instance of the [Margins](../../com.groupdocs.watermark.watermarks/margins) class.

Margins(int marginType, double left, double right, double top, double bottom)

public Margins(int marginType, double left, double right, double top, double bottom)

Initializes a new instance of the [Margins](../../com.groupdocs.watermark.watermarks/margins) class with the specified type, location and size.

Parameters:

Parameter Type Description
marginType int The [MarginType](../../com.groupdocs.watermark.watermarks/margintype). Specifies how margin values should be interpreted.
left double The left margin value.
right double The right margin value.
top double The top margin value.
bottom double The bottom margin value.

getMarginType()

public final int getMarginType()

Gets [MarginType](../../com.groupdocs.watermark.watermarks/margintype). Setting a new value to this property automatically returns all margins to their default values (zero).

The default value is [MarginType.Absolute](../../com.groupdocs.watermark.watermarks/margintype#Absolute)

Returns: int - The value specifying how margins should be interpreted.

setMarginType(int value)

public final void setMarginType(int value)

Sets [MarginType](../../com.groupdocs.watermark.watermarks/margintype). Setting a new value to this property automatically returns all margins to their default values (zero).

The default value is [MarginType.Absolute](../../com.groupdocs.watermark.watermarks/margintype#Absolute)

Parameters:

Parameter Type Description
value int The value specifying how margins should be interpreted.

getLeft()

public final double getLeft()

Gets the left margin.

Returns: double - Horizontal offset from parent left border.

setLeft(double value)

public final void setLeft(double value)

Sets the left margin.

Parameters:

Parameter Type Description
value double Horizontal offset from parent left border.

getRight()

public final double getRight()

Gets the right margin.

Returns: double - Horizontal offset from parent right border.

setRight(double value)

public final void setRight(double value)

Sets the right margin.

Parameters:

Parameter Type Description
value double Horizontal offset from parent right border.

getTop()

public final double getTop()

Gets the top margin.

Returns: double - Horizontal offset from parent top border.

setTop(double value)

public final void setTop(double value)

Sets the top margin.

Parameters:

Parameter Type Description
value double Horizontal offset from parent top border.

getBottom()

public final double getBottom()

Gets the bottom margin.

Returns: double - Horizontal offset from parent bottom border.

setBottom(double value)

public final void setBottom(double value)

Sets the bottom margin.

Parameters:

Parameter Type Description
value double Horizontal offset from parent bottom border.