Public Member Functions | Static Public Attributes | Protected Member Functions

de.softpro.doc.SignDocWatermark Class Reference

Parameters for a watermark. More...

List of all members.

Public Member Functions

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

Static Public Attributes

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

Protected Member Functions

void finalize () throws Throwable
 Finalize this object.

Detailed Description

Parameters for a watermark.

See also:
SignDocDocument.addWatermark()
Todo:

fromFile(): PDF/image, page number, absolute scale

setUnderline()


Constructor & Destructor Documentation

de.softpro.doc.SignDocWatermark.SignDocWatermark (  ) throws SignDocException

Constructor.


Member Function Documentation

synchronized void de.softpro.doc.SignDocWatermark.clear (  ) throws SignDocException

Reset all parameters to their default values.

synchronized Object de.softpro.doc.SignDocWatermark.clone (  ) throws CloneNotSupportedException

Clone this object.

Returns:
A clone of this object.
void de.softpro.doc.SignDocWatermark.finalize (  ) throws Throwable [protected]

Finalize this object.

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

synchronized void de.softpro.doc.SignDocWatermark.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 de.softpro.doc.SignDocWatermark.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 de.softpro.doc.SignDocWatermark.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.loadFontConfigFile(), SignDocDocumentLoader.loadFontConfigEnvironment(), SignDocDocumentLoader.loadFontConfigStream()
synchronized void de.softpro.doc.SignDocWatermark.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 de.softpro.doc.SignDocWatermark.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 de.softpro.doc.SignDocWatermark.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 de.softpro.doc.SignDocWatermark.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 de.softpro.doc.SignDocWatermark.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 de.softpro.doc.SignDocWatermark.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 de.softpro.doc.SignDocWatermark.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 de.softpro.doc.SignDocWatermark.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 de.softpro.doc.SignDocWatermark.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 de.softpro.doc.SignDocWatermark.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 de.softpro.doc.SignDocWatermark.setTextColor ( SignDocColor  aTextColor ) throws SignDocException

Set the text color.

The default value is black (gray).

Parameters:
[in]aTextColorThe text color.
synchronized void de.softpro.doc.SignDocWatermark.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 de.softpro.doc.SignDocWatermark.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 de.softpro.doc.SignDocWatermark.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 de.softpro.doc.SignDocWatermark.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 de.softpro.doc.SignDocWatermark.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.

Horizontal alignment: Center.

Horizontal alignment: Align left.

Horizontal alignment: Align right.

Justification: center.

Justification: left.

Justification: right.

Location of watermark: Watermark appears on top of page.

Location of watermark: Watermark appears behind page.

Vertical alignment: Align bottom.

Vertical alignment: Center.

Vertical alignment: Align top.


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