Foxit PDF SDK
FSWatermarkSettings Class Reference

Inherits NSObject.

Instance Methods

(id) - init
 Constructor.

 
(id) - initWithPosition:offset_x:offset_y:flags:scale_x:scale_y:rotation:opacity:is_offset_centered:relative_scale_to_page:
 Constructor, with parameters.
More...
 
(id) - initWithSettings:
 Constructor, with another watermark settings object.
More...
 
(void) - set:offset_x:offset_y:flags:scale_x:scale_y:rotation:opacity:is_offset_centered:relative_scale_to_page:
 Set value.
More...
 

Properties

unsigned int flags
 Watermark flags.
More...
 
BOOL is_offset_centered
 If true, position is invaild, and offset is the centered of the watermark. If false, offset is relative to the position.

 
float offset_x
 Horizontal offset, in points.

 
float offset_y
 Vertical offset, in points.

 
int opacity
 Opacity in percents. Valid range: from 0 to 100. 0 for fully transparent and 100 for fully opaque.

 
FSPosition position
 Watermark position.
More...
 
float relative_scale_to_page
 Relative scale to target page. Valid range: from 0 to 1 (exclusive of 0). If the value is 0 or greater than 1, this feature is disabled and scale_x/scale_y will be used instead. Default value: 0 (disabled).

 
float rotation
 Rotation angle in degrees.

 
float scale_x
 Horizontal scale coefficient. It should be greater than 0.001f.

 
float scale_y
 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.

此类表示和OFD水印相关的位置属性。

Method Documentation

◆ initWithPosition:offset_x:offset_y:flags:scale_x:scale_y:rotation:opacity:is_offset_centered:relative_scale_to_page:()

- (id) initWithPosition: (FSPosition)  position
offset_x: (float)  offset_x
offset_y: (float)  offset_y
flags: (unsigned int)  flags
scale_x: (float)  scale_x
scale_y: (float)  scale_y
rotation: (float)  rotation
opacity: (int)  opacity
is_offset_centered: (BOOL)  is_offset_centered
relative_scale_to_page: (float)  relative_scale_to_page 

Constructor, with parameters.

Parameters
[in]positionWatermark position. Please refer to values starting from FSPosTopLeft 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 FSWatermarkSettingsFlagASPageContents 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.
[in]opacityOpacity in percents. Valid range: from 0 to 100. 0 for fully transparent and 100 for fully opaque.
[in]is_offset_centeredA boolean value which indicates whether offset is based on the watermark center. YES means that the offset is based on the watermark center and the position will be ignored. NO means not.

[in]relative_scale_to_pageRelative scale to target page. Valid range: from 0 to 1 (exclusive of 0). If the value is 0 or greater than 1, this feature is disabled and scale_x/scale_y will be used instead.

◆ initWithSettings:()

- (id) initWithSettings: (FSWatermarkSettings*)  settings

Constructor, with another watermark settings object.

构造函数,通过另一个水印位置属性对象。

Parameters
[in]settingsAnother watermark settings object.
[in]settings另一个水印位置属性对象。

◆ set:offset_x:offset_y:flags:scale_x:scale_y:rotation:opacity:is_offset_centered:relative_scale_to_page:()

- (void) set: (FSPosition)  position
offset_x: (float)  offset_x
offset_y: (float)  offset_y
flags: (unsigned int)  flags
scale_x: (float)  scale_x
scale_y: (float)  scale_y
rotation: (float)  rotation
opacity: (int)  opacity
is_offset_centered: (BOOL)  is_offset_centered
relative_scale_to_page: (float)  relative_scale_to_page 

Set value.

Parameters
[in]positionWatermark position. Please refer to values starting from FSPosTopLeft 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 FSWatermarkSettingsFlagASPageContents 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.
[in]opacityOpacity in percents. Valid range: from 0 to 100. 0 for fully transparent and 100 for fully opaque.
[in]is_offset_centeredA boolean value which indicates whether offset is based on the watermark center. YES means that the offset is based on the watermark center and the position will be ignored. NO means not.
[in]relative_scale_to_pageRelative scale to target page. Valid range: from 0 to 1 (exclusive of 0). If the value is 0 or greater than 1, this feature is disabled and scale_x/scale_y will be used instead.
Returns
None.

Property Documentation

◆ flags

- (unsigned int) flags
readwritenonatomicassign

Watermark flags.

Please refer to values starting from FSWatermarkSettingsFlagASPageContents and this can be one or a combination of these values.

◆ position

- (FSPosition) position
readwritenonatomicassign

Watermark position.

Please refer to values starting from FSPosTopLeft and this should be one of these values.