SignDoc SDK (C++)  5.0.0
SignDocWatermark Class Reference

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. More...
 
 SignDocWatermark (const SignDocWatermark &aSource)
 Copy constructor. More...
 
 ~SignDocWatermark ()
 Destructor. More...
 
SignDocWatermarkoperator= (const SignDocWatermark &aSource)
 Assignment operator. More...
 
void swap (SignDocWatermark &aOther)
 Efficiently swap this object with another one. More...
 
void clear ()
 Reset all parameters to their default values. More...
 
void setText (Encoding aEncoding, const std::string &aText)
 Set the text to be used for the watermark. More...
 
void setFontName (Encoding aEncoding, const std::string &aFontName)
 Set the name of the font. More...
 
void setFontSize (double aFontSize)
 Set the font size. More...
 
void setTextColor (const SignDocColor &aTextColor)
 Set the text color. More...
 
void setJustification (Justification aJustification)
 Set the justification for multi-line text. More...
 
void setRotation (double aRotation)
 Set the rotation. More...
 
void setOpacity (double aOpacity)
 Set the opacity. More...
 
void setScale (double aScale)
 Disable scaling or set scaling relative to page. More...
 
void setLocation (Location aLocation)
 Set whether the watermark will appear behind the page or on top of the page. More...
 
void setHorizontalPosition (HAlignment aAlignment, double aDistance)
 Set the horizontal position of the watermark. More...
 
void setVerticalPosition (VAlignment aAlignment, double aDistance)
 Set the vertical position of the watermark. More...
 
void setFirstPage (int aPage)
 Set the first page number. More...
 
void setLastPage (int aPage)
 Set the last page number. More...
 
void setPageIncrement (int aIncr)
 Set the page number increment. More...
 
void setFlags (int aFlags)
 Set flags. More...
 
 SignDocWatermark (SIGNDOC_Watermark *aP)
 Internal function. More...
 
SIGNDOC_Watermark * getImpl ()
 Internal function. More...
 
const SIGNDOC_Watermark * getImpl () const
 Internal function. More...
 
void setImpl (SIGNDOC_Watermark *aP)
 Internal function. More...
 

Detailed Description

Parameters for a watermark.

See also
SignDocDocument::addWatermark()

Member Enumeration Documentation

enum Flags

Flags for setFlags().

Enumerator
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.

enum HAlignment

Horizontal alignment.

Enumerator
ha_left 

Align left.

ha_center 

Center.

ha_right 

Align right.

Justification of multi-line text.

Enumerator
j_left 
j_center 
j_right 
enum Location

Location of watermark.

Enumerator
l_overlay 

Watermark appears on top of page.

l_underlay 

Watermark appears behind page.

enum VAlignment

Vertical alignment.

Enumerator
va_top 

Align top.

va_center 

Center.

va_bottom 

Align bottom.

Constructor & Destructor Documentation

SignDocWatermark ( )
inline

Constructor.

All parameters are set to their default values.

SignDocWatermark ( const SignDocWatermark aSource)
inline

Copy constructor.

Parameters
[in]aSourceThe object to be copied.
~SignDocWatermark ( )
inline

Destructor.

SignDocWatermark ( SIGNDOC_Watermark *  aP)
inline

Internal function.

Member Function Documentation

void clear ( )
inline

Reset all parameters to their default values.

SIGNDOC_Watermark* getImpl ( )
inline

Internal function.

const SIGNDOC_Watermark* getImpl ( ) const
inline

Internal function.

SignDocWatermark & operator= ( const SignDocWatermark aSource)
inline

Assignment operator.

Parameters
[in]aSourceThe source object.
Returns
This object.
void setFirstPage ( int  aPage)
inline

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()
void setFlags ( int  aFlags)
inline

Set flags.

Initially, no flag is set.

Parameters
[in]aFlagsSee enum Flags.
See also
setText()
void 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".

Parameters
[in]aEncodingThe encoding of aFontName.
[in]aFontNameThe new font name.
See also
setFontSize(), setTextColor(), SignDocDocumentLoader::loadFontConfigBlob(), SignDocDocumentLoader::loadFontConfigEnvironment(), SignDocDocumentLoader::loadFontConfigFile(), SignDocDocumentLoader::loadFontConfigStream()
void setFontSize ( double  aFontSize)
inline

Set the font size.

The default value is 24.

Parameters
[in]aFontSizeThe font size (in user space units).
See also
setFontName(), setScale()
void 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.

Parameters
[in]aAlignmentMeasure distance from here.
[in]aDistanceThe distance in user space units.
See also
setScale(), setVerticalPosition()
void setImpl ( SIGNDOC_Watermark *  aP)
inline

Internal function.

void setJustification ( Justification  aJustification)
inline

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.
See also
setText()
void setLastPage ( int  aPage)
inline

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()
void 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.

Parameters
[in]aLocationl_overlay or l_underlay.
See also
setOpacity()
void 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.

Parameters
[in]aOpacityThe opacity, 0.0 (transparent) through 1.0 (opaque).
See also
setLocation()
void 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)

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

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.
void setScale ( double  aScale)
inline

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.
void 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.

Parameters
[in]aEncodingThe encoding of aText.
[in]aTextThe text. Complex scripts are supported, see Complex Scripts.
See also
setFlags(), setFontName(), setFontSize(), setJustification(), setTextColor()
void setTextColor ( const SignDocColor aTextColor)
inline

Set the text color.

The default value is black (gray scale).

Parameters
[in]aTextColorThe text color.
void 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.

Parameters
[in]aAlignmentMeasure distance from here.
[in]aDistanceThe distance in user space units.
See also
setHorizontalPosition(), setScale()
void swap ( SignDocWatermark aOther)
inline

Efficiently swap this object with another one.

Parameters
[in]aOtherThe other object.

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