Parameters for a watermark. More...
#include <SignDocSDK-cpp.h>
Public Types | |
enum | Justification { j_left, j_center, j_right } |
Justification of multi-line text. More... | |
enum | Location { l_overlay, l_underlay } |
Location of watermark. More... | |
enum | HAlignment { ha_left, ha_center, ha_right } |
Horizontal alignment. More... | |
enum | VAlignment { va_top, va_center, va_bottom } |
Vertical alignment. More... | |
enum | Flags { f_ltr = 0x1000, f_rtl = 0x2000, f_default_ltr = 0x4000, f_default_rtl = 0x8000 } |
Flags for setFlags(). More... | |
Public Member Functions | |
SignDocWatermark () | |
Constructor. | |
SignDocWatermark (const SignDocWatermark &aSource) | |
Copy constructor. | |
~SignDocWatermark () | |
Destructor. | |
SignDocWatermark & | operator= (const SignDocWatermark &aSource) |
Assignment operator. | |
void | swap (SignDocWatermark &aOther) |
Efficiently swap this object with another one. | |
void | clear () |
Reset all parameters to their default values. | |
void | setText (Encoding aEncoding, const std::string &aText) |
Set the text to be used for the watermark. | |
void | setFontName (Encoding aEncoding, const std::string &aFontName) |
Set the name of the font. | |
void | setFontSize (double aFontSize) |
Set the font size. | |
void | setTextColor (const SignDocColor &aTextColor) |
Set the text color. | |
void | setJustification (Justification aJustification) |
Set the justification for multi-line text. | |
void | setRotation (double aRotation) |
Set the rotation. | |
void | setOpacity (double aOpacity) |
Set the opacity. | |
void | setScale (double aScale) |
Disable scaling or set scaling relative to page. | |
void | setLocation (Location aLocation) |
Set whether the watermark will appear behind the page or on top of the page. | |
void | setHorizontalPosition (HAlignment aAlignment, double aDistance) |
Set the horizontal position of the watermark. | |
void | setVerticalPosition (VAlignment aAlignment, double aDistance) |
Set the vertical position of the watermark. | |
void | setFirstPage (int aPage) |
Set the first page number. | |
void | setLastPage (int aPage) |
Set the last page number. | |
void | setPageIncrement (int aIncr) |
Set the page number increment. | |
void | setFlags (int aFlags) |
Set flags. | |
SignDocWatermark (SIGNDOC_Watermark *aP) | |
Internal function. | |
SIGNDOC_Watermark * | getImpl () |
Internal function. | |
const SIGNDOC_Watermark * | getImpl () const |
Internal function. | |
void | setImpl (SIGNDOC_Watermark *aP) |
Internal function. |
Parameters for a watermark.
fromFile(): PDF/image, page number, absolute scale
setUnderline()
Flags for setFlags().
f_ltr |
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. |
f_rtl |
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. |
f_default_ltr |
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. |
f_default_rtl |
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. |
de::softpro::doc::SignDocWatermark::SignDocWatermark | ( | ) | [inline] |
Constructor.
All parameters are set to their default values.
de::softpro::doc::SignDocWatermark::SignDocWatermark | ( | const SignDocWatermark & | aSource ) | [inline] |
Copy constructor.
[in] | aSource | The object to be copied. |
de::softpro::doc::SignDocWatermark::~SignDocWatermark | ( | ) | [inline] |
Destructor.
de::softpro::doc::SignDocWatermark::SignDocWatermark | ( | SIGNDOC_Watermark * | aP ) | [inline] |
Internal function.
void de::softpro::doc::SignDocWatermark::clear | ( | ) | [inline] |
Reset all parameters to their default values.
SIGNDOC_Watermark* de::softpro::doc::SignDocWatermark::getImpl | ( | ) | [inline] |
Internal function.
const SIGNDOC_Watermark* de::softpro::doc::SignDocWatermark::getImpl | ( | ) | const [inline] |
Internal function.
SignDocWatermark& de::softpro::doc::SignDocWatermark::operator= | ( | const SignDocWatermark & | aSource ) | [inline] |
Assignment operator.
[in] | aSource | The source object. |
void de::softpro::doc::SignDocWatermark::setFirstPage | ( | int | aPage ) | [inline] |
Set the first page number.
The default value is 1.
[in] | aPage | The 1-based page number of the first page. |
void de::softpro::doc::SignDocWatermark::setFlags | ( | int | aFlags ) | [inline] |
void de::softpro::doc::SignDocWatermark::setFontName | ( | Encoding | aEncoding, |
const std::string & | aFontName | ||
) | [inline] |
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] | aEncoding | The encoding of aFontName. |
[in] | aFontName | The new font name. |
void de::softpro::doc::SignDocWatermark::setFontSize | ( | double | aFontSize ) | [inline] |
Set the font size.
The default value is 24.
[in] | aFontSize | The font size (in user space units). |
void de::softpro::doc::SignDocWatermark::setHorizontalPosition | ( | HAlignment | aAlignment, |
double | aDistance | ||
) | [inline] |
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. |
[in] | aDistance | The distance in user space units. |
void de::softpro::doc::SignDocWatermark::setImpl | ( | SIGNDOC_Watermark * | aP ) | [inline] |
Internal function.
void de::softpro::doc::SignDocWatermark::setJustification | ( | Justification | aJustification ) | [inline] |
void de::softpro::doc::SignDocWatermark::setLastPage | ( | int | aPage ) | [inline] |
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. |
void de::softpro::doc::SignDocWatermark::setLocation | ( | Location | aLocation ) | [inline] |
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. |
void de::softpro::doc::SignDocWatermark::setOpacity | ( | double | aOpacity ) | [inline] |
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). |
void de::softpro::doc::SignDocWatermark::setPageIncrement | ( | int | aIncr ) | [inline] |
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. |
void de::softpro::doc::SignDocWatermark::setRotation | ( | double | aRotation ) | [inline] |
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. |
void de::softpro::doc::SignDocWatermark::setScale | ( | double | aScale ) | [inline] |
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. |
void de::softpro::doc::SignDocWatermark::setText | ( | Encoding | aEncoding, |
const std::string & | aText | ||
) | [inline] |
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] | aEncoding | The encoding of aText. |
[in] | aText | The text. Complex scripts are supported, see Complex Scripts. |
void de::softpro::doc::SignDocWatermark::setTextColor | ( | const SignDocColor & | aTextColor ) | [inline] |
Set the text color.
The default value is black (gray scale).
[in] | aTextColor | The text color. |
void de::softpro::doc::SignDocWatermark::setVerticalPosition | ( | VAlignment | aAlignment, |
double | aDistance | ||
) | [inline] |
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. |
[in] | aDistance | The distance in user space units. |
void de::softpro::doc::SignDocWatermark::swap | ( | SignDocWatermark & | aOther ) | [inline] |
Efficiently swap this object with another one.
[in] | aOther | The other object. |