com.adobe.livecycle.rightsmanagement.client.infomodel
Interface Watermark

All Superinterfaces:
java.lang.Cloneable

public interface Watermark
extends java.lang.Cloneable

The Watermark interface defines methods for the creation and manipulation of watermarks. In addition to the name of the watermark, Watermark objects must define the text that appears as the watermark in the documents. The text can be one or more of the following properties:

The following properties can be set to affect the appearance of the watermark:

For information about using this interface as part of creating watermarks using the Document Security Java API, see the Creating a new watermark using the Java API quick start in Programming with Adobe Experience Manager Forms.


Field Summary
static java.lang.String HORIZONTAL_ALIGNMENT_CENTER
          Represents center horizontal alignment.
static java.lang.String HORIZONTAL_ALIGNMENT_LEFT
          Represents left horizontal alignment.
static java.lang.String HORIZONTAL_ALIGNMENT_RIGHT
          Represents right horizontal alignment.
static java.lang.String VERTICAL_ALIGNMENT_BOTTOM
          Represents bottom vertical alignment.
static java.lang.String VERTICAL_ALIGNMENT_CENTER
          Represents center vertical alignment.
static java.lang.String VERTICAL_ALIGNMENT_TOP
          Represents top vertical alignment.
 
Method Summary
 java.lang.String getCustomText()
          Retrieves the custom text that the watermark includes.
 java.lang.String getHorizontalAlignment()
          Retrieves the horizontal alignment setting for the watermark.
 float getHorizontalOffset()
          Retrieves the offset of the watermark from the aligned position ( position is specified by alignment @see WatermarkBOConstants )
 java.lang.String getId()
          Retrieves the identification of the watermark.
 java.lang.String getName()
          Retrieves the name of the watermark.
 int getOpacity()
          Retrieves the opacity of the watermark.
 int getRotation()
          Retrieves the rotation of the watermark.
 int getScale()
          Retrieves the size of the watermark font.
 java.lang.String getVerticalAlignment()
          Retrieves the vertical alignment setting for the watermark.
 float getVerticalOffset()
          Retrieves the offset of the watermark from the aligned position ( position is specified by alignment )
 boolean isBackground()
          Retrieves whether the watermark appears in the background of the document.
 boolean isDateIncluded()
          Retrieves whether the watermark includes the date when the associated document is opened.
 boolean isDeleted()
          Retrieves the state of the watermark.
 boolean isPolicyNameIncluded()
          Retrieves whether the watermark includes the name of the policy applied to the associated document
 boolean isUserIdIncluded()
          Retrieves whether the watermark includes the user identification of the user who opened the associated document.
 boolean isUserNameIncluded()
          Retrieves whether the watermark includes the name of the user who opened the associated document.
 void setBackground(boolean background)
          Sets whether the watermark appears in background or foreground of the document.
 void setCustomText(java.lang.String customText)
          Sets the custom text that the watermark includes.
 void setDateIncluded(boolean include)
          Sets whether the watermark includes the date when the associated document is opened.
 void setHorizontalAlignment(java.lang.String alignment)
          Sets the horizontal alignment for the watermark.
 void setHorizontalOffset(float offset)
          Sets the Offset of the watermark from the aligned position.
 void setName(java.lang.String name)
          Sets the name for the watermark.
 void setOpacity(int percent)
          Sets the opacity of the watermark.
 void setPolicyNameIncluded(boolean include)
          Specifies whether the watermark includes the name of the policy applied to the associated document
 void setRotation(int degrees)
          Sets the rotation of the watermark.
 void setScale(int scale)
          Sets the size of the watermark font.
 void setUserIdIncluded(boolean include)
          Specifies whether the watermark includes the user identification of the user who opened the associated document.
 void setUserNameIncluded(boolean include)
          Specifies whether the watermark includes the user name of the user who opened the associated document.
 void setVerticalAlignment(java.lang.String alignment)
          Sets the vertical alignment for the watermark.
 void setVerticalOffset(float offset)
          Sets the offset of the watermark from the aligned position.
 

Field Detail

HORIZONTAL_ALIGNMENT_LEFT

static final java.lang.String HORIZONTAL_ALIGNMENT_LEFT
Represents left horizontal alignment.

See Also:
Constant Field Values

HORIZONTAL_ALIGNMENT_CENTER

static final java.lang.String HORIZONTAL_ALIGNMENT_CENTER
Represents center horizontal alignment.

See Also:
Constant Field Values

HORIZONTAL_ALIGNMENT_RIGHT

static final java.lang.String HORIZONTAL_ALIGNMENT_RIGHT
Represents right horizontal alignment.

See Also:
Constant Field Values

VERTICAL_ALIGNMENT_TOP

static final java.lang.String VERTICAL_ALIGNMENT_TOP
Represents top vertical alignment.

See Also:
Constant Field Values

VERTICAL_ALIGNMENT_CENTER

static final java.lang.String VERTICAL_ALIGNMENT_CENTER
Represents center vertical alignment.

See Also:
Constant Field Values

VERTICAL_ALIGNMENT_BOTTOM

static final java.lang.String VERTICAL_ALIGNMENT_BOTTOM
Represents bottom vertical alignment.

See Also:
Constant Field Values
Method Detail

isUserNameIncluded

boolean isUserNameIncluded()
Retrieves whether the watermark includes the name of the user who opened the associated document.

Returns:
A Boolean value of true if the watermark includes the user name and false if it does not include the user name.

setUserNameIncluded

void setUserNameIncluded(boolean include)
Specifies whether the watermark includes the user name of the user who opened the associated document.

Parameters:
include - A Boolean value of true if the watermark should include the user name and false if it should not include the user name.

isUserIdIncluded

boolean isUserIdIncluded()
Retrieves whether the watermark includes the user identification of the user who opened the associated document.

Returns:
A Boolean value of true if the watermark includes the user identification and false if it does not include the user name.

setUserIdIncluded

void setUserIdIncluded(boolean include)
Specifies whether the watermark includes the user identification of the user who opened the associated document.

Parameters:
include - A Boolean value of true if the watermark should include the user identification, or false if the user identification is not included.

isPolicyNameIncluded

boolean isPolicyNameIncluded()
Retrieves whether the watermark includes the name of the policy applied to the associated document

Returns:
A Boolean value of true if the watermark includes the policy name and false if it does not include the policy name.

setPolicyNameIncluded

void setPolicyNameIncluded(boolean include)
Specifies whether the watermark includes the name of the policy applied to the associated document

Parameters:
include - A Boolean value of true if the watermark should include the user policy name, or false if it should not include the policy name.

isDateIncluded

boolean isDateIncluded()
Retrieves whether the watermark includes the date when the associated document is opened.

Returns:
A Boolean value of true if the watermark includes the date and false if it does not include the date.

setDateIncluded

void setDateIncluded(boolean include)
Sets whether the watermark includes the date when the associated document is opened.

Parameters:
include - A Boolean value of true if the watermark should include the date and false it should not include the date.

getCustomText

java.lang.String getCustomText()
Retrieves the custom text that the watermark includes.

Returns:
A string value that specifies the custom text for the watermark and null if no custom text is specified.

setCustomText

void setCustomText(java.lang.String customText)
Sets the custom text that the watermark includes. For example, if a document includes sensitive information, the custom text could be Confidential.

Parameters:
customText - A string value that includes the custom text to include in the watermark and null if no custom text should be included.

getOpacity

int getOpacity()
Retrieves the opacity of the watermark.

Returns:
An integer that contains the opacity of the watermark as a percentage. A value of 100 indicates the watermark is completely opaque. A value of 0 indicuates the watermark is completely transparent.

setOpacity

void setOpacity(int percent)
                throws PDRLException
Sets the opacity of the watermark.

Parameters:
percent - An integer that contains the opacity of the watermark. This value can be between 0 and 100. A value of 100 indicates the watermark is completely opaque. A value of 0 indicates the watermark is completely transparent.
Throws:
PDRLException - if percent is not in the range of valid values.

isBackground

boolean isBackground()
Retrieves whether the watermark appears in the background of the document. If the watermark is in the background, it appears behind the content of the document. If the watermark is not in the background, it appears superimposed on the document content.

Returns:
A Boolean value of true if the watermark appears in the background, and false if it appears in the foreground.

setBackground

void setBackground(boolean background)
Sets whether the watermark appears in background or foreground of the document. If the watermark is in the background, it appears behind the content of the document. If the watermark is not in the background, it appears superimposed on the document content.

Parameters:
background - A Boolean value of true if the watermark should appear in the background and false if the watermark should appear in the foreground.

getRotation

int getRotation()
Retrieves the rotation of the watermark. The rotation is measured counterclockwise, starting from zero when the watermark is horizontal and read from left to right.

Returns:
An integer that contains the rotation of the watermark, in degrees.

setRotation

void setRotation(int degrees)
                 throws PDRLException
Sets the rotation of the watermark. The rotation is measured counterclockwise, with a value of zero when the watermark is horizontal and read from left to right. For example, a rotation of 180 degrees causes the watermark to appear upside down.

Parameters:
degrees - An integer that specifies the rotation of the watermark, in degrees. degrees can be any integer value between -180 and 180.
Throws:
PDRLException - if degrees is not within the valid range of values.

getScale

int getScale()
Retrieves the size of the watermark font. The default is Fit to page.

Returns:
An integer that holds the size of the watermark as a percentage of the default size.

setScale

void setScale(int scale)
              throws PDRLException
Sets the size of the watermark font. The default is Fit to page.

Parameters:
scale - An integer that specifies the size of the watermark font as a percentage of the default size. scale can be any integer value between 0 and 100.
Throws:
PDRLException - if scale is not within the valid range of values.

getHorizontalAlignment

java.lang.String getHorizontalAlignment()
Retrieves the horizontal alignment setting for the watermark.

Returns:
A java.lang.String that contains the constant value that represents the horizontal alignment.

The constant can be one of the following values:

  • HORIZONTAL_ALIGNMENT_LEFT
  • HORIZONTAL_ALIGNMENT_CENTER
  • HORIZONTAL_ALIGNMENT_RIGHT

setHorizontalAlignment

void setHorizontalAlignment(java.lang.String alignment)
                            throws PDRLException
Sets the horizontal alignment for the watermark. The watermark can be set to be left-aligned, right-aligned, or horizontally centered on the page of the document.

Parameters:
alignment - A java.lang.String that contains one of the following three values:
  • HORIZONTAL_ALIGNMENT_LEFT - specifies that the watermark is left-aligned.
  • HORIZONTAL_ALIGNMENT_RIGHT - specifies that the watermark is right-aligned.
  • HORIZONTAL_ALIGNMENT_CENTER - specifies that the watermark is horizontally centered on the page (the default value).
Throws:
PDRLException - if alignment does not contain a valid constant value.

getHorizontalOffset

float getHorizontalOffset()
Retrieves the offset of the watermark from the aligned position ( position is specified by alignment @see WatermarkBOConstants )

Returns:
offset of the watermark from the aligned position

setHorizontalOffset

void setHorizontalOffset(float offset)
                         throws PDRLException
Sets the Offset of the watermark from the aligned position.

Parameters:
offset - offset of the watermark from the aligned position.
Throws:
PDRLException

getVerticalAlignment

java.lang.String getVerticalAlignment()
Retrieves the vertical alignment setting for the watermark.

Returns:
A string value that specifies the constant value that represents the vertical alignment.

The constant can be one of the following values:

  • VERTICAL_ALIGNMENT_TOP
  • VERTICAL_ALIGNMENT_CENTER
  • VERTICAL_ALIGNMENT_BOTTOM

setVerticalAlignment

void setVerticalAlignment(java.lang.String alignment)
                          throws PDRLException
Sets the vertical alignment for the watermark. The watermark can be set to be aligned with the top of the page, the bottom of the page, or the center of the page of the document.

Parameters:
alignment - A string value that specifies one of the following values:
  • VERTICAL_ALIGNMENT_TOP - specifies that the watermark is top-aligned.
  • VERTICAL_ALIGNMENT_BOTTOM - specifies that the watermark is bottom-aligned.
  • VERTICAL_ALIGNMENT_CENTER - specifies that the watermark is vertically centered on the page (the default value).
Throws:
PDRLException - if alignment does not contain a valid constant value.

getVerticalOffset

float getVerticalOffset()
Retrieves the offset of the watermark from the aligned position ( position is specified by alignment )

Returns:
the offset of the watermark from the aligned position

setVerticalOffset

void setVerticalOffset(float offset)
                       throws PDRLException
Sets the offset of the watermark from the aligned position.

Parameters:
offset - offset of the watermark from the aligned position
Throws:
PDRLException

getName

java.lang.String getName()
Retrieves the name of the watermark.

Returns:
A java.lang.String that contains the name of the watermark.

setName

void setName(java.lang.String name)
             throws PDRLException
Sets the name for the watermark.

Parameters:
name - A java.lang.String that contains the name for the watermark. name can have a maximum length of 50 characters.
Throws:
PDRLException - if name is longer than the allowed length.

isDeleted

boolean isDeleted()
Retrieves the state of the watermark. Watermarks can be either active or deleted. If the watermark is deleted it can no longer be used with policies, however deleted watermarks still appear in documents protected by policies that were created before the watermark was deleted.

Returns:
A Boolean value of true if the watermark is deleted and false if the watermark is active.

getId

java.lang.String getId()
Retrieves the identification of the watermark.

Returns:
A string value that contains the identification of the watermark and null if this Watermark object represents a watermark that is not registered with the Rights Management service.