Public Types | Public Member Functions

de::softpro::doc::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.
 SignDocWatermark (const SignDocWatermark &aSource)
 Copy constructor.
 ~SignDocWatermark ()
 Destructor.
SignDocWatermarkoperator= (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.

Detailed Description

Parameters for a watermark.

See also:
SignDocDocument::addWatermark()
Todo:

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

setUnderline()


Member Enumeration Documentation

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.

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 

Location of watermark.

Enumerator:
l_overlay 

Watermark appears on top of page.

l_underlay 

Watermark appears behind page.

Vertical alignment.

Enumerator:
va_top 

Align top.

va_center 

Cwenter.

va_bottom 

Align bottom.


Constructor & Destructor Documentation

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.

Parameters:
[in]aSourceThe object to be copied.
de::softpro::doc::SignDocWatermark::~SignDocWatermark (  ) [inline]

Destructor.

de::softpro::doc::SignDocWatermark::SignDocWatermark ( SIGNDOC_Watermark *  aP ) [inline]

Internal function.


Member Function Documentation

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.

Parameters:
[in]aSourceThe source object.
void de::softpro::doc::SignDocWatermark::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 de::softpro::doc::SignDocWatermark::setFlags ( int  aFlags ) [inline]

Set flags.

Initially, no flag is set.

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

Parameters:
[in]aEncodingThe encoding of aFontName.
[in]aFontNameThe new font name.
See also:
setFontSize(), setTextColor(), SignDocDocumentLoader::loadFontConfigFile(), SignDocDocumentLoader::loadFontConfigEnvironment(), SignDocDocumentLoader::loadFontConfigStream()
void de::softpro::doc::SignDocWatermark::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 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.

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

Internal function.

void de::softpro::doc::SignDocWatermark::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 de::softpro::doc::SignDocWatermark::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 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.

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

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

Parameters:
[in]aIncrAdd this number to the page number when iterating over pages adding watermarks. Must be positive.
See also:
setFirstPage(), setLastPage()
void de::softpro::doc::SignDocWatermark::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 de::softpro::doc::SignDocWatermark::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 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.

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

Set the text color.

The default value is black (gray scale).

Parameters:
[in]aTextColorThe 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.

Parameters:
[in]aAlignmentMeasure distance from here.
[in]aDistanceThe distance in user space units.
See also:
setHorizontalPosition(), setScale()
void de::softpro::doc::SignDocWatermark::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: