com.adobe.livecycle.rightsmanagement.client.infomodel
Class Watermark2Element

java.lang.Object
  extended by com.adobe.livecycle.rightsmanagement.client.infomodel.Watermark2Element
All Implemented Interfaces:
java.lang.Cloneable

public abstract class Watermark2Element
extends java.lang.Object
implements java.lang.Cloneable

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

For pdf watermarks, Watermark Element objects must specify the watermark PDF document.

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

The following properties specifies the visibility options:

For information about using this interface as part of creating watermarks using the Rights Management Java API, see the Creating a new watermark using the Java API quick start in Programming with LiveCycle ES4.


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 TYPE_PDF
          Represents pdf watermark type
static java.lang.String TYPE_TEXT
          Represents text watermark type
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.
 
Constructor Summary
Watermark2Element()
           
 
Method Summary
abstract  java.awt.Color getBGColor()
          Retrieves the background color for the watermark element.
abstract  java.lang.String getCustomText()
          Retrieves the custom text that the watermark element includes.
abstract  java.lang.String getDescription()
          Retrieves the name of the watermark element.
abstract  java.lang.Integer getEndPage()
          Retrieves the end page for the watermark element.
abstract  java.awt.Color getFGColor()
          Retrieves the foreground color for the watermark element.
abstract  java.lang.String getFontName()
          Retrieves the font name of the watermark element.
abstract  java.lang.Integer getFontSize()
          Retrieves the font size of the watermark element.
abstract  java.lang.String getHorizontalAlignment()
          Retrieves the horizontal alignment setting for the watermark element.
abstract  float getHorizontalOffset()
          Retrieves the horizontal alignment's offset setting for the watermark element.
abstract  java.lang.String getId()
          Retrieves the identification of the watermark element.
abstract  java.lang.String getName()
          Retrieves the name of the watermark element element.
abstract  int getOpacity()
          Retrieves the opacity of the watermark element.
abstract  Document getPDFContent()
          Retrieves the pdf document which is used as the watermark content for the watermark element.
abstract  int getRotation()
          Retrieves the rotation of the watermark element.
abstract  int getScale()
          Retrieves the size of the watermark element font.
abstract  java.lang.Integer getStartPage()
          Retrieves the start page for the watermark element.
abstract  java.lang.String getType()
          Retrieves the type of the watermark element.
abstract  java.lang.String getVerticalAlignment()
          Retrieves the vertical alignment setting for the watermark element.
abstract  float getVerticalOffset()
          Retrieves the vertical alignment's offset setting for the watermark element.
abstract  boolean isBackground()
          Retrieves whether the watermark element appears in the background of the document.
abstract  boolean isDateIncluded()
          Retrieves whether the watermark element includes the date when the associated document is opened.
abstract  boolean isDeleted()
          Retrieves the state of the watermark element.
abstract  boolean isPolicyNameIncluded()
          Retrieves whether the watermark element includes the name of the policy applied to the associated document This property is not used when the type of watermark element is TYPE_PDF.
abstract  boolean isShowOnPrint()
          Retrieves whether the watermark element appears on print.
abstract  boolean isShowOnScreen()
          Retrieves whether the watermark element appears on screen.
abstract  boolean isUserIdIncluded()
          Retrieves whether the watermark element includes the user identification of the user who opened the associated document.
abstract  boolean isUserNameIncluded()
          Retrieves whether the watermark element includes the name of the user who opened the associated document.
abstract  void setBackground(boolean background)
          Sets whether the watermark element appears in background or foreground of the document.
abstract  void setBGColor(java.awt.Color color)
          Sets the background color of the watermark element.
abstract  void setCustomText(java.lang.String customText)
          Sets the custom text that the watermark element includes.
abstract  void setDateIncluded(boolean include)
          Sets whether the watermark element includes the date when the associated document is opened.
abstract  void setDescription(java.lang.String description)
          Sets the description of the watermark element
abstract  void setEndPage(java.lang.Integer endPage)
          Sets the end page option for the watermark element
abstract  void setFGColor(java.awt.Color color)
          Sets the foreground color of the watermark element.
abstract  void setFontName(java.lang.String font)
          Sets the font name for the watermark element.
abstract  void setFontSize(java.lang.Integer size)
          Sets the font size of the watermark element.
abstract  void setHorizontalAlignment(java.lang.String alignment)
          Sets the horizontal alignment for the watermark element.
abstract  void setHorizontalOffset(float offset)
          Sets the horizontal alignment's offset for the watermark element.
abstract  void setName(java.lang.String name)
          Sets the name for the watermark.
abstract  void setOpacity(int percent)
          Sets the opacity of the watermark element.
abstract  void setPDFContent(Document pdfContent, java.lang.String fileName)
          Sets the pdf document which is used as the watermark content for the watermark element.
abstract  void setPolicyNameIncluded(boolean include)
          Specifies whether the watermark element includes the name of the policy applied to the associated document This property is not used when the type of watermark element is TYPE_PDF.
abstract  void setRotation(int degrees)
          Sets the rotation of the watermark element.
abstract  void setScale(int scale)
          Sets the size of the watermark element font.
abstract  void setShowOnPrint(boolean showOnPrint)
          Sets whether the watermark element appears on print.
abstract  void setShowOnScreen(boolean showOnScreen)
          Sets whether the watermark element appears on screen.
abstract  void setStartPage(java.lang.Integer startPage)
          Sets the start page option for the watermark element
abstract  void setType(java.lang.String type)
          Specifies the type of the watermark element.
abstract  void setUserIdIncluded(boolean include)
          Specifies whether the watermark element includes the user identification of the user who opened the associated document.
abstract  void setUserNameIncluded(boolean include)
          Specifies whether the watermark element includes the user name of the user who opened the associated document.
abstract  void setVerticalAlignment(java.lang.String alignment)
          Sets the vertical alignment for the watermark element.
abstract  void setVerticalOffset(float offset)
          Sets the vertical alignment's offset for the watermark element.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

HORIZONTAL_ALIGNMENT_LEFT

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

See Also:
Constant Field Values

HORIZONTAL_ALIGNMENT_CENTER

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

See Also:
Constant Field Values

HORIZONTAL_ALIGNMENT_RIGHT

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

See Also:
Constant Field Values

VERTICAL_ALIGNMENT_TOP

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

See Also:
Constant Field Values

VERTICAL_ALIGNMENT_CENTER

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

See Also:
Constant Field Values

VERTICAL_ALIGNMENT_BOTTOM

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

See Also:
Constant Field Values

TYPE_TEXT

public static final java.lang.String TYPE_TEXT
Represents text watermark type

See Also:
Constant Field Values

TYPE_PDF

public static final java.lang.String TYPE_PDF
Represents pdf watermark type

See Also:
Constant Field Values
Constructor Detail

Watermark2Element

public Watermark2Element()
Method Detail

setType

public abstract void setType(java.lang.String type)
                      throws PDRLException
Specifies the type of the watermark element. Type can be either text or pdf.

Parameters:
type - A java.lang.String that contains one of the following three values:
  • TYPE_TEXT - specifies that the watermark element is of type text.
  • TYPE_PDF - specifies that the watermark element is of type pdf.
Throws:
PDRLException - if type does not contain a valid constant value.

getType

public abstract java.lang.String getType()
Retrieves the type of the watermark element.

Returns:
A string value that specifies the constant value that represents the type of the watermark element.

The constant can be one of the following values:

  • TYPE_TEXT
  • TYPE_PDF

isUserNameIncluded

public abstract boolean isUserNameIncluded()
Retrieves whether the watermark element includes the name of the user who opened the associated document. This property is not used when the type of watermark element is TYPE_PDF.

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

setUserNameIncluded

public abstract void setUserNameIncluded(boolean include)
Specifies whether the watermark element includes the user name of the user who opened the associated document. This property is not used when the type of watermark element is TYPE_PDF.

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

isUserIdIncluded

public abstract boolean isUserIdIncluded()
Retrieves whether the watermark element includes the user identification of the user who opened the associated document. This property is not used when the type of watermark element is TYPE_PDF.

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

setUserIdIncluded

public abstract void setUserIdIncluded(boolean include)
Specifies whether the watermark element includes the user identification of the user who opened the associated document. This property is not used when the type of watermark element is TYPE_PDF.

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

isPolicyNameIncluded

public abstract boolean isPolicyNameIncluded()
Retrieves whether the watermark element includes the name of the policy applied to the associated document This property is not used when the type of watermark element is TYPE_PDF.

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

setPolicyNameIncluded

public abstract void setPolicyNameIncluded(boolean include)
Specifies whether the watermark element includes the name of the policy applied to the associated document This property is not used when the type of watermark element is TYPE_PDF.

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

isDateIncluded

public abstract boolean isDateIncluded()
Retrieves whether the watermark element includes the date when the associated document is opened. This property is not used when the type of watermark element is TYPE_PDF.

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

setDateIncluded

public abstract void setDateIncluded(boolean include)
Sets whether the watermark element includes the date when the associated document is opened. This property is not used when the type of watermark element is TYPE_PDF.

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

getCustomText

public abstract java.lang.String getCustomText()
Retrieves the custom text that the watermark element includes. This property is not used when the type of watermark element is TYPE_PDF.

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

setCustomText

public abstract void setCustomText(java.lang.String customText)
Sets the custom text that the watermark element includes. This property is not used when the type of watermark element is TYPE_PDF. 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 element and null if no custom text should be included.

getPDFContent

public abstract Document getPDFContent()
Retrieves the pdf document which is used as the watermark content for the watermark element. This property is not used when the type of watermark element is TYPE_TEXT.

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

setPDFContent

public abstract void setPDFContent(Document pdfContent,
                                   java.lang.String fileName)
                            throws SDKException
Sets the pdf document which is used as the watermark content for the watermark element.

Parameters:
pdfContent - A pdf document. the document should be a valid unprotected pdf document.
fileName - (optional) the file name that will appear in the UI. If null, then we will not show any file name info in the UI.
Throws:
SDKException - if pdfContent does not contain a valid pdf document.

getOpacity

public abstract int getOpacity()
Retrieves the opacity of the watermark element.

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

setOpacity

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

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

isBackground

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

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

setBackground

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

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

getRotation

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

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

setRotation

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

Parameters:
degrees - An integer that specifies the rotation of the watermark element, 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

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

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

setScale

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

Parameters:
scale - An integer that specifies the size of the watermark element 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

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

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

getHorizontalOffset

public abstract float getHorizontalOffset()
Retrieves the horizontal alignment's offset setting for the watermark element.

Returns:
A float that contains the constant value that represents the horizontal alignment's offset.

setHorizontalAlignment

public abstract void setHorizontalAlignment(java.lang.String alignment)
                                     throws PDRLException
Sets the horizontal alignment for the watermark element. The watermark element 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 element is left-aligned.
  • HORIZONTAL_ALIGNMENT_RIGHT - specifies that the watermark element is right-aligned.
  • HORIZONTAL_ALIGNMENT_CENTER - specifies that the watermark element is horizontally centered on the page (the default value).
Throws:
PDRLException - if alignment does not contain a valid constant value.

setHorizontalOffset

public abstract void setHorizontalOffset(float offset)
                                  throws PDRLException
Sets the horizontal alignment's offset for the watermark element.

Parameters:
offset - A float that contains the horizontal alignment's offset
Throws:
PDRLException - if offset is greater than or equal to 10000f or lesss than or equal to -10000f

getVerticalAlignment

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

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

getVerticalOffset

public abstract float getVerticalOffset()
Retrieves the vertical alignment's offset setting for the watermark element.

Returns:
a float value that specifies the value that represents the vertical alignment's offset.

setVerticalAlignment

public abstract void setVerticalAlignment(java.lang.String alignment)
                                   throws PDRLException
Sets the vertical alignment for the watermark element. The watermark element 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 element is top-aligned.
  • VERTICAL_ALIGNMENT_BOTTOM - specifies that the watermark element is bottom-aligned.
  • VERTICAL_ALIGNMENT_CENTER - specifies that the watermark element is vertically centered on the page (the default value).
Throws:
PDRLException - if alignment does not contain a valid constant value.

setVerticalOffset

public abstract void setVerticalOffset(float offset)
                                throws PDRLException
Sets the vertical alignment's offset for the watermark element.

Parameters:
offset - A float that contains the vertical alignment's offset
Throws:
PDRLException - if offset is greater than or equal to 10000f or lesss than or equal to -10000f

getName

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

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

setName

public abstract 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 element. name can have a maximum length of 50 characters.
Throws:
PDRLException - if name is longer than the allowed length.

setDescription

public abstract void setDescription(java.lang.String description)
                             throws PDRLException
Sets the description of the watermark element

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

getDescription

public abstract java.lang.String getDescription()
Retrieves the name of the watermark element.

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

isDeleted

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

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

getId

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

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

setStartPage

public abstract void setStartPage(java.lang.Integer startPage)
                           throws PDRLException
Sets the start page option for the watermark element

Parameters:
startPage - A java.lang.Integer that contains the start page number for the watermark element. startPage should be in the range 0-9999.
Throws:
PDRLException - if startPage is not in specified range.

getStartPage

public abstract java.lang.Integer getStartPage()
Retrieves the start page for the watermark element.

Returns:
A java.lang.Integer that contains the start page number for the watermark element.

setEndPage

public abstract void setEndPage(java.lang.Integer endPage)
                         throws PDRLException
Sets the end page option for the watermark element

Parameters:
endPage - A java.lang.Integer that contains the end page number for the watermark element. endPage should be in the range -1-9999. -1 means till the end.
Throws:
PDRLException - if endPage is not in specified range.

getEndPage

public abstract java.lang.Integer getEndPage()
Retrieves the end page for the watermark element.

Returns:
A java.lang.Integer that contains the end page number for the watermark element.

isShowOnScreen

public abstract boolean isShowOnScreen()
Retrieves whether the watermark element appears on screen.

Returns:
A Boolean value of true if the watermark element appears on screen, and false otherwise.

setShowOnScreen

public abstract void setShowOnScreen(boolean showOnScreen)
Sets whether the watermark element appears on screen.

Parameters:
showOnScreen - A Boolean value of true if the watermark element should appear on screen, and false otherwise.

isShowOnPrint

public abstract boolean isShowOnPrint()
Retrieves whether the watermark element appears on print.

Returns:
A Boolean value of true if the watermark element appears on print, and false otherwise.

setShowOnPrint

public abstract void setShowOnPrint(boolean showOnPrint)
Sets whether the watermark element appears on print.

Parameters:
showOnPrint - A Boolean value of true if the watermark element should appear on print, and false otherwise.

getFontSize

public abstract java.lang.Integer getFontSize()
Retrieves the font size of the watermark element. The default is 24. Not used when watermark type is set to pdf

Returns:
An integer that holds the font size of the watermark element.

setFontSize

public abstract void setFontSize(java.lang.Integer size)
                          throws PDRLException
Sets the font size of the watermark element. Not used when watermark type is set to pdf

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

getFontName

public abstract java.lang.String getFontName()
Retrieves the font name of the watermark element. Not used when watermark type is set to pdf

Returns:
A String that holds the font naem of the watermark element. Default fonts are used if this is not set or set to an empty string.

setFontName

public abstract void setFontName(java.lang.String font)
Sets the font name for the watermark element. Not used when watermark type is set to pdf

Parameters:
font - A String that specifies the font name for the watermark element. if font is null or empty string then default values are used for font for the watermark element.

getFGColor

public abstract java.awt.Color getFGColor()
Retrieves the foreground color for the watermark element. The default is white. Not used when watermark type is set to pdf

Returns:
A Color value that holds the foreground color for the watermark element.

setFGColor

public abstract void setFGColor(java.awt.Color color)
Sets the foreground color of the watermark element. Not used when watermark type is set to pdf Set to null for the defaults

Parameters:
color - A color value that specifies the foreground color for the watermark element.

getBGColor

public abstract java.awt.Color getBGColor()
Retrieves the background color for the watermark element. The default is white. Not used when watermark type is set to pdf

Returns:
A Color value that holds the background color for the watermark element.

setBGColor

public abstract void setBGColor(java.awt.Color color)
Sets the background color of the watermark element. Not used when watermark type is set to pdf Set to null for the defaults

Parameters:
color - A color value that specifies the background color for the watermark element.


[an error occurred while processing this directive] [an error occurred while processing this directive]