SignDoc SDK (Java)  5.0.0
SignDocWatermark Class Reference

Parameters for a watermark. More...

Inheritance diagram for SignDocWatermark:

Public Member Functions

 SignDocWatermark () throws SignDocException
 Constructor. More...
 
synchronized SignDocWatermark clone () throws SignDocException
 Clone this object. More...
 
synchronized void clear () throws SignDocException
 Reset all parameters to their default values. More...
 
synchronized void setText (String aText) throws SignDocException
 Set the text to be used for the watermark. More...
 
synchronized void setFontName (String aFontName) throws SignDocException
 Set the name of the font. More...
 
synchronized void setFontSize (double aFontSize) throws SignDocException
 Set the font size. More...
 
synchronized void setTextColor (SignDocColor aTextColor) throws SignDocException
 Set the text color. More...
 
synchronized void setJustification (int aJustification) throws SignDocException
 Set the justification for multi-line text. More...
 
synchronized void setRotation (double aRotation) throws SignDocException
 Set the rotation. More...
 
synchronized void setOpacity (double aOpacity) throws SignDocException
 Set the opacity. More...
 
synchronized void setScale (double aScale) throws SignDocException
 Disable scaling or set scaling relative to page. More...
 
synchronized void setLocation (int aLocation) throws SignDocException
 Set whether the watermark will appear behind the page or on top of the page. More...
 
synchronized void setHorizontalPosition (int aAlignment, double aDistance) throws SignDocException
 Set the horizontal position of the watermark. More...
 
synchronized void setVerticalPosition (int aAlignment, double aDistance) throws SignDocException
 Set the vertical position of the watermark. More...
 
synchronized void setFirstPage (int aPage) throws SignDocException
 Set the first page number. More...
 
synchronized void setLastPage (int aPage) throws SignDocException
 Set the last page number. More...
 
synchronized void setPageIncrement (int aIncr) throws SignDocException
 Set the page number increment. More...
 
synchronized void setFlags (int aFlags) throws SignDocException
 Set flags. More...
 
synchronized void close ()
 Destroy the underlying native object (for java.lang.AutoCloseable). More...
 

Static Public Attributes

static final int j_left = 0
 Justification: left. More...
 
static final int j_center = 1
 Justification: center. More...
 
static final int j_right = 2
 Justification: right. More...
 
static final int l_overlay = 0
 Location of watermark: Watermark appears on top of page. More...
 
static final int l_underlay = 1
 Location of watermark: Watermark appears behind page. More...
 
static final int ha_left = 0
 Horizontal alignment: Align left. More...
 
static final int ha_center = 1
 Horizontal alignment: Center. More...
 
static final int ha_right = 2
 Horizontal alignment: Align right. More...
 
static final int va_top = 0
 Vertical alignment: Align top. More...
 
static final int va_center = 1
 Vertical alignment: Center. More...
 
static final int va_bottom = 2
 Vertical alignment: Align bottom. More...
 
static final int f_ltr = 0x1000
 Flag for setFlags(): Paragraph direction: LTR. More...
 
static final int f_rtl = 0x2000
 Flag for setFlags(): Paragraph direction: RTL. More...
 
static final int f_default_ltr = 0x4000
 Flag for setFlags(): Choose direction automatically, default to LTR. More...
 
static final int f_default_rtl = 0x8000
 Flag for setFlags(): Choose direction automatically, default to RTL. More...
 

Protected Member Functions

void finalize () throws Throwable
 Finalize this object. More...
 

Detailed Description

Parameters for a watermark.

See also
SignDocDocument.addWatermark()

Constructor & Destructor Documentation

Constructor.

Member Function Documentation

synchronized void clear ( ) throws SignDocException

Reset all parameters to their default values.

synchronized SignDocWatermark clone ( ) throws SignDocException

Clone this object.

Returns
A clone of this object.
synchronized void close ( )

Destroy the underlying native object (for java.lang.AutoCloseable).

After calling this method, all methods but close() will throw SignDocUnexpectedErrorException.

void finalize ( ) throws Throwable
protected

Finalize this object.

Do not call this method unless you know what you are doing.

synchronized void setFirstPage ( int  aPage) throws SignDocException

Set the first page number.

The default value is 1.

Parameters
[in]aPageThe 1-based page number of the first page.
See also
setLastPage(), setPageIncrement()
synchronized void setFlags ( int  aFlags) throws SignDocException

Set flags.

Initially, no flag is set.

Parameters
[in]aFlagsSee f_ltr, f_rtl, f_default_ltr, and f_default_rtl.
See also
setText()
synchronized void setFontName ( String  aFontName) throws SignDocException

Set the name of the font.

The font name can be the name of a standard font, the name of an already embedded font, or the name of a font defined by a font configuration file.

The default value is "Helvetica".

Parameters
[in]aFontNameThe new font name.
See also
setFontSize(), setTextColor(), SignDocDocumentLoader.loadFontConfigBlob(), SignDocDocumentLoader.loadFontConfigFile(), SignDocDocumentLoader.loadFontConfigEnvironment(), SignDocDocumentLoader.loadFontConfigStream()
synchronized void setFontSize ( double  aFontSize) throws SignDocException

Set the font size.

The default value is 24.

Parameters
[in]aFontSizeThe font size (in user space units).
See also
setFontName(), setScale()
synchronized void setHorizontalPosition ( int  aAlignment,
double  aDistance 
) throws SignDocException

Set the horizontal position of the watermark.

The default values are ha_center and 0.

The distance is measured from the left edge of the page to the left edge of the watermark (ha_left), from the center of the page to the center of the watermark (ha_center), or from the right edge of the page to the right edge of the watermark (ha_right).

For ha_left and ha_center, positive values push the watermark to the right, for ha_right, positive values push the watermark to the left.

Parameters
[in]aAlignmentMeasure distance from here: ha_left, ha_center, or ha_right.
[in]aDistanceThe distance in user space units.
See also
setScale(), setVerticalPosition()
synchronized void setJustification ( int  aJustification) throws SignDocException

Set the justification for multi-line text.

The default value is j_left.

If the text (see setText()) contains only one line (ie, no newline characters), this parameter will be ignored.

Parameters
[in]aJustificationThe justification: j_left, j_center, or j_right.
See also
setText()
synchronized void setLastPage ( int  aPage) throws SignDocException

Set the last page number.

The default value is 0.

Parameters
[in]aPageThe 1-based page number of the last page or 0 for the last page of the document.
See also
setFirstPage(), setPageIncrement()
synchronized void setLocation ( int  aLocation) throws SignDocException

Set whether the watermark will appear behind the page or on top of the page.

The default value is l_overlay.

Parameters
[in]aLocationl_overlay or l_underlay.
See also
setOpacity()
synchronized void setOpacity ( double  aOpacity) throws SignDocException

Set the opacity.

The default value is 1.0. Documents conforming to PDF/A-1 must use an opacity of 1.0.

Parameters
[in]aOpacityThe opacity, 0.0 (transparent) through 1.0 (opaque).
See also
setLocation()
synchronized void setPageIncrement ( int  aIncr) throws SignDocException

Set the page number increment.

The default value is 1 (add watermark to all pages between the first page and the last page)

Parameters
[in]aIncrAdd this number to the page number when iterating over pages adding watermarks. Must be positive.
See also
setFirstPage(), setLastPage()
synchronized void setRotation ( double  aRotation) throws SignDocException

Set the rotation.

The default value is 0.

Parameters
[in]aRotationThe rotation in degrees (-180 through 180), 0 is horizontal (left to right), 45 is bottom left to upper right.
synchronized void setScale ( double  aScale) throws SignDocException

Disable scaling or set scaling relative to page.

The default value is 0.5.

Parameters
[in]aScale0 to disable scaling (use the font size set by setFontSize()) or 0.01 through 64.0 to scale relative to the page size.
synchronized void setText ( String  aText) throws SignDocException

Set the text to be used for the watermark.

The default value is empty.

The text can contain multiple lines, the newline character is used to separate lines. If there are multiple lines, their relative position is specified by setJustification().

Complex scripts are supported, see Complex Scripts. By default, this function uses paragraph direction LTR. Use setFlags() if you need to set a different paragraph direction.

Parameters
[in]aTextThe text. Complex scripts are supported, see Complex Scripts.
See also
setFlags(), setFontName(), setFontSize(), setJustification(), setTextColor()
synchronized void setTextColor ( SignDocColor  aTextColor) throws SignDocException

Set the text color.

The default value is black (gray).

Parameters
[in]aTextColorThe text color.
synchronized void setVerticalPosition ( int  aAlignment,
double  aDistance 
) throws SignDocException

Set the vertical position of the watermark.

The default values are va_center and 0.

The distance is measured from the top edge of the page to the top edge of the watermark (va_top), from the center of the page to the center of the watermark (va_center), or from the bottom edge of the page to the bottom edge of the watermark (va_bottom).

For va_bottom and va_center, positive values push the watermark up, for va_top, positive values push the watermark down.

Parameters
[in]aAlignmentMeasure distance from here: va_top, va_center, or va_bottom.
[in]aDistanceThe distance in user space units.
See also
setHorizontalPosition(), setScale()

Member Data Documentation

final int f_default_ltr = 0x4000
static

Flag for setFlags(): Choose direction automatically, default to LTR.

The base direction of each paragraph (BiDi paragraph level) will depend on the first strong directional character in the paragraph.

The paragraph level will be 0 (LTR) for paragraphs having no strong directional character.

If none of f_ltr, f_rtl, f_default_ltr, and f_default_rtl is set, f_ltr will be used.

At most one of f_ltr, f_rtl, f_default_ltr, and f_default_rtl can be set.

final int f_default_rtl = 0x8000
static

Flag for setFlags(): Choose direction automatically, default to RTL.

The base direction of each paragraph (BiDi paragraph level) will depend on the first strong directional character in the paragraph.

The paragraph level will be 1 (RTL) for paragraphs having no strong directional character.

If none of f_ltr, f_rtl, f_default_ltr, and f_default_rtl is set, f_ltr will be used.

At most one of f_ltr, f_rtl, f_default_ltr, and f_default_rtl can be set.

final int f_ltr = 0x1000
static

Flag for setFlags(): Paragraph direction: LTR.

If none of f_ltr, f_rtl, f_default_ltr, and f_default_rtl is set, f_ltr will be used.

At most one of f_ltr, f_rtl, f_default_ltr, and f_default_rtl can be set.

final int f_rtl = 0x2000
static

Flag for setFlags(): Paragraph direction: RTL.

If none of f_ltr, f_rtl, f_default_ltr, and f_default_rtl is set, f_ltr will be used.

At most one of f_ltr, f_rtl, f_default_ltr, and f_default_rtl can be set.

final int ha_center = 1
static

Horizontal alignment: Center.

final int ha_left = 0
static

Horizontal alignment: Align left.

final int ha_right = 2
static

Horizontal alignment: Align right.

final int j_center = 1
static

Justification: center.

final int j_left = 0
static

Justification: left.

final int j_right = 2
static

Justification: right.

final int l_overlay = 0
static

Location of watermark: Watermark appears on top of page.

final int l_underlay = 1
static

Location of watermark: Watermark appears behind page.

final int va_bottom = 2
static

Vertical alignment: Align bottom.

final int va_center = 1
static

Vertical alignment: Center.

final int va_top = 0
static

Vertical alignment: Align top.


The documentation for this class was generated from the following file: