Foxit PDF SDK
foxit.pdf.WatermarkSettings Class Reference

Inherits SystemIDisposable.

Public Types

enum  Flags {
  Flags.e_FlagASPageContents = 0x0000, Flags.e_FlagASAnnot = 0x0001, Flags.e_FlagOnTop = 0x0002, Flags.e_FlagNoPrint = 0x0004,
  Flags.e_FlagInvisible = 0x0008, Flags.e_FlagShareImageStream = 0x0010, Flags.e_FlagShareTextStream = 0x0020, Flags.e_FlagSharePageStream = 0x0040
}
 Enumeration for watermark setting flags. More...
 

Public Member Functions

 WatermarkSettings (Position position, float offset_x, float offset_y, int flags, float scale_x, float scale_y, float rotation, int opacity)
 Constructor, with parameters. More...
 
 WatermarkSettings ()
 Constructor.
 
 WatermarkSettings (WatermarkSettings settings)
 Constructor, with another watermark settings object. More...
 
void Set (Position position, float offset_x, float offset_y, int flags, float scale_x, float scale_y, float rotation, int opacity)
 Set value. More...
 

Properties

int flags [get, set]
 Watermark flags. More...
 
float offset_x [get, set]
 Horizontal offset, in points.
 
float offset_y [get, set]
 Vertical offset, in points.
 
int opacity [get, set]
 Opacity in percents. Valid range: from 0 to 100. 0 for fully transparent and 100 for fully opaque.
 
Position position [get, set]
 Watermark position. More...
 
float rotation [get, set]
 Rotation angle in degrees.
 
float scale_x [get, set]
 Horizontal scale coefficient. It should be greater than 0.001f.
 
float scale_y [get, set]
 Vertical scale coefficient. It should be greater than 0.001f.
 

Detailed Description

This class represents the watermark settings used to construct a watermark object from any supported resource.

Member Enumeration Documentation

◆ Flags

Enumeration for watermark setting flags.

Values of this enumeration can be used alone or in combination. For more details about form xobjects, please refer to Section 4.9 "Form XObjects" in <PDF Reference 1.7>.

Enumerator
e_FlagASPageContents 

If set, the watermark will be a part of page content when inserted to a PDF page.

e_FlagASAnnot 

If set, the watermark will be an annotation when inserted to a PDF page.

e_FlagOnTop 

If set, show watermark above other page content.

e_FlagNoPrint 

If set, do not print a watermark.

e_FlagInvisible 

If set, do not display a watermark.

e_FlagShareImageStream 

If set, watermarks will share one image stream if these watermarks use the same image or bitmap.

e_FlagShareTextStream 

If set, watermarks will share one form xobject if these watermarks use the same text and text's related properties.

e_FlagSharePageStream 

If set, watermarks will share one form xobject if these watermarks use the same page object.

Constructor & Destructor Documentation

◆ WatermarkSettings() [1/2]

foxit.pdf.WatermarkSettings.WatermarkSettings ( Position  position,
float  offset_x,
float  offset_y,
int  flags,
float  scale_x,
float  scale_y,
float  rotation,
int  opacity 
)
inline

Constructor, with parameters.

Parameters
[in]positionWatermark position. Please refer to values starting from foxit.common.Position.e_PosTopLeft and this should be one of these values.
[in]offset_xHorizontal offset, in points.
[in]offset_yVertical offset, in points.
[in]flagsWatermark flags. Please refer to values starting from foxit.pdf.WatermarkSettings.Flags.e_FlagASPageContents and this can be one or a combination of these values.
[in]scale_xHorizontal scale coefficient. It should be greater than 0.001f.
[in]scale_yVertical scale coefficient. It should be greater than 0.001f.
[in]rotationRotation angle in degrees. It should be greater than 0.001f.
[in]opacityOpacity in percents. Valid range: from 0 to 100. 0 for fully transparent and 100 for fully opaque.

◆ WatermarkSettings() [2/2]

foxit.pdf.WatermarkSettings.WatermarkSettings ( WatermarkSettings  settings)
inline

Constructor, with another watermark settings object.

Parameters
[in]settingsAnother watermark settings object.

Member Function Documentation

◆ Set()

void foxit.pdf.WatermarkSettings.Set ( Position  position,
float  offset_x,
float  offset_y,
int  flags,
float  scale_x,
float  scale_y,
float  rotation,
int  opacity 
)
inline

Set value.

Parameters
[in]positionWatermark position. Please refer to values starting from foxit.common.Position.e_PosTopLeft and this should be one of these values.
[in]offset_xHorizontal offset, in points.
[in]offset_yVertical offset, in points.
[in]flagsWatermark flags. Please refer to values starting from foxit.pdf.WatermarkSettings.Flags.e_FlagASPageContents and this can be one or a combination of these values.
[in]scale_xHorizontal scale coefficient. It should be greater than 0.001f.
[in]scale_yVertical scale coefficient. It should be greater than 0.001f.
[in]rotationRotation angle in degrees. It should be greater than 0.001f.
[in]opacityOpacity in percents. Valid range: from 0 to 100. 0 for fully transparent and 100 for fully opaque.
Returns
None.

Property Documentation

◆ flags

int foxit.pdf.WatermarkSettings.flags
getset

Watermark flags.

Please refer to values starting from foxit.pdf.WatermarkSettings.Flags.e_FlagASPageContents and this can be one or a combination of these values.

◆ position

Position foxit.pdf.WatermarkSettings.position
getset

Watermark position.

Please refer to values starting from foxit.common.Position.e_PosTopLeft and this should be one of these values.