Parameters for a watermark. More...
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. |
Parameters for a watermark.
fromFile(): PDF/image, page number, absolute scale
setUnderline()
de.softpro.doc.SignDocWatermark.SignDocWatermark | ( | ) | throws SignDocException |
Constructor.
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.
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.
[in] | aPage | The 1-based page number of the first page. |
synchronized void de.softpro.doc.SignDocWatermark.setFlags | ( | int | aFlags ) | throws SignDocException |
Set flags.
Initially, no flag is set.
[in] | aFlags | See f_ltr, f_rtl, f_default_ltr, and f_default_rtl. |
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".
[in] | aFontName | The new font name. |
synchronized void de.softpro.doc.SignDocWatermark.setFontSize | ( | double | aFontSize ) | throws SignDocException |
Set the font size.
The default value is 24.
[in] | aFontSize | The font size (in user space units). |
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.
[in] | aAlignment | Measure distance from here: ha_left, ha_center, or ha_right. |
[in] | aDistance | The distance in user space units. |
synchronized void de.softpro.doc.SignDocWatermark.setJustification | ( | int | aJustification ) | throws SignDocException |
synchronized void de.softpro.doc.SignDocWatermark.setLastPage | ( | int | aPage ) | throws SignDocException |
Set the last page number.
The default value is 0.
[in] | aPage | The 1-based page number of the last page or 0 for the last page of the document. |
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.
[in] | aLocation | l_overlay or l_underlay. |
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.
[in] | aOpacity | The opacity, 0.0 (transparent) through 1.0 (opaque). |
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)
[in] | aIncr | Add this number to the page number when iterating over pages adding watermarks. Must be positive. |
synchronized void de.softpro.doc.SignDocWatermark.setRotation | ( | double | aRotation ) | throws SignDocException |
Set the rotation.
The default value is 0.
[in] | aRotation | The 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.
[in] | aScale | 0 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.
[in] | aText | The text. Complex scripts are supported, see Complex Scripts. |
synchronized void de.softpro.doc.SignDocWatermark.setTextColor | ( | SignDocColor | aTextColor ) | throws SignDocException |
Set the text color.
The default value is black (gray).
[in] | aTextColor | The 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.
[in] | aAlignment | Measure distance from here: va_top, va_center, or va_bottom. |
[in] | aDistance | The distance in user space units. |
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.
final int de.softpro.doc.SignDocWatermark.ha_center = 1 [static] |
Horizontal alignment: Center.
final int de.softpro.doc.SignDocWatermark.ha_left = 0 [static] |
Horizontal alignment: Align left.
final int de.softpro.doc.SignDocWatermark.ha_right = 2 [static] |
Horizontal alignment: Align right.
final int de.softpro.doc.SignDocWatermark.j_center = 1 [static] |
Justification: center.
final int de.softpro.doc.SignDocWatermark.j_left = 0 [static] |
Justification: left.
final int de.softpro.doc.SignDocWatermark.j_right = 2 [static] |
Justification: right.
final int de.softpro.doc.SignDocWatermark.l_overlay = 0 [static] |
Location of watermark: Watermark appears on top of page.
final int de.softpro.doc.SignDocWatermark.l_underlay = 1 [static] |
Location of watermark: Watermark appears behind page.
final int de.softpro.doc.SignDocWatermark.va_bottom = 2 [static] |
Vertical alignment: Align bottom.
final int de.softpro.doc.SignDocWatermark.va_center = 1 [static] |
Vertical alignment: Center.
final int de.softpro.doc.SignDocWatermark.va_top = 0 [static] |
Vertical alignment: Align top.