Foxit PDF SDK

Public Member Functions | Static Public Attributes | List of all members
com.foxit.sdk.pdf.WatermarkSettings Class Reference

## Public Member Functions
| WatermarkSettings (int 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...
synchronized void | delete ()
| Clean up related C++ resources immediately. More...
int | getFlags ()
| Get watermark flags. More...
float | getOffset_x ()
| Get horizontal offset, in points. More...
float | getOffset_y ()
| Get vertical offset, in points. More...
int | getOpacity ()
| Get opacity in percents. More...
int | getPosition ()
| Get watermark position. More...
float | getRotation ()
| Get rotation angle in degrees. More...
float | getScale_x ()
| Get horizontal scale coefficient. More...
float | getScale_y ()
| Get vertical scale coefficient. More...
void | set (int position, float offset_x, float offset_y, int flags, float scale_x, float scale_y, float rotation, int opacity)
| Set value. More...
void | setFlags (int value)
| Set watermark flags. More...
void | setOffset_x (float value)
| Set horizontal offset, in points. More...
void | setOffset_y (float value)
| Set vertical offset, in points. More...
void | setOpacity (int value)
| Set opacity in percents. More...
void | setPosition (int value)
| Set watermark position. More...
void | setRotation (float value)
| Set rotation angle in degrees. More...
void | setScale_x (float value)
| Set horizontal scale coefficient. More...
void | setScale_y (float value)
| Set vertical scale coefficient. More...

## Static Public Attributes
static final int | e_FlagASAnnot = 0x0001
| If set, the watermark will be an annotation when inserted to a PDF page.
static final int | e_FlagASPageContents = 0x0000
| If set, the watermark will be a part of page content when inserted to a PDF page.
static final int | e_FlagInvisible = 0x0008
| If set, do not display a watermark.
static final int | e_FlagNoPrint = 0x0004
| If set, do not print a watermark.
static final int | e_FlagOnTop = 0x0002
| If set, show watermark above other page content.
static final int | e_FlagShareImageStream = 0x0010
| If set, watermarks will share one image stream if these watermarks use the same image or bitmap.
static final int | e_FlagSharePageStream = 0x0040
| If set, watermarks will share one form xobject if these watermarks use the same page object.
static final int | e_FlagShareTextStream = 0x0020
| If set, watermarks will share one form xobject if these watermarks use the same text and text's related properties.

## Detailed Description

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

## Constructor & Destructor Documentation

## ◆ WatermarkSettings() [1/2]

com.foxit.sdk.pdf.WatermarkSettings.WatermarkSettings | ( | int | position,
|  | float | offset_x,
|  | float | offset_y,
|  | int | flags,
|  | float | scale_x,
|  | float | scale_y,
|  | float | rotation,
|  | int | opacity
| ) |  |

Constructor, with parameters.

Parameters

  [in] | position | Watermark position. Please refer to values starting from com.foxit.sdk.common.Constants.e_PosTopLeft and this should be one of these values.
  [in] | offset_x | Horizontal offset, in points.
  [in] | offset_y | Vertical offset, in points.
  [in] | flags | Watermark flags. Please refer to values starting from com.foxit.sdk.pdf.WatermarkSettings.e_FlagASPageContents and this can be one or a combination of these values.
  [in] | scale_x | Horizontal scale coefficient. It should be greater than 0.001f.
  [in] | scale_y | Vertical scale coefficient. It should be greater than 0.001f.
  [in] | rotation | Rotation angle in degrees.
  [in] | opacity | Opacity in percents. Valid range: from 0 to 100. 0 for fully transparent and 100 for fully opaque.

## ◆ WatermarkSettings() [2/2]

com.foxit.sdk.pdf.WatermarkSettings.WatermarkSettings | ( | WatermarkSettings | settings | ) |

Constructor, with another watermark settings object.

Parameters

  [in] | settings | Another watermark settings object.

## Member Function Documentation

## ◆ delete()

synchronized void com.foxit.sdk.pdf.WatermarkSettings.delete | ( |  | ) |

Clean up related C++ resources immediately.

Returns
  None.

Note
  Once this function is called, current object cannot be used anymore.

## ◆ getFlags()

com.foxit.sdk.pdf.WatermarkSettings.getFlags | ( |  | ) |

Get watermark flags.

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

Returns
  Watermark flags.

## ◆ getOffset_x()

com.foxit.sdk.pdf.WatermarkSettings.getOffset_x | ( |  | ) |

Get horizontal offset, in points.

Returns
  Horizontal offset, in points.

## ◆ getOffset_y()

com.foxit.sdk.pdf.WatermarkSettings.getOffset_y | ( |  | ) |

Get vertical offset, in points.

Returns
  Vertical offset, in points.

## ◆ getOpacity()

com.foxit.sdk.pdf.WatermarkSettings.getOpacity | ( |  | ) |

Get opacity in percents.

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

## ◆ getPosition()

com.foxit.sdk.pdf.WatermarkSettings.getPosition | ( |  | ) |

Get watermark position.

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

Returns
  Watermark position.

## ◆ getRotation()

com.foxit.sdk.pdf.WatermarkSettings.getRotation | ( |  | ) |

Get rotation angle in degrees.

Returns
  Rotation angle in degrees.

## ◆ getScale_x()

com.foxit.sdk.pdf.WatermarkSettings.getScale_x | ( |  | ) |

Get horizontal scale coefficient.

Returns
  Horizontal scale coefficient. It should be greater than 0.001f.

## ◆ getScale_y()

com.foxit.sdk.pdf.WatermarkSettings.getScale_y | ( |  | ) |

Get vertical scale coefficient.

Returns
  Vertical scale coefficient. It should be greater than 0.001f.

## ◆ set()

void com.foxit.sdk.pdf.WatermarkSettings.set | ( | int | position,
|  | float | offset_x,
|  | float | offset_y,
|  | int | flags,
|  | float | scale_x,
|  | float | scale_y,
|  | float | rotation,
|  | int | opacity
| ) |  |

Set value.

Parameters

  [in] | position | Watermark position. Please refer to values starting from com.foxit.sdk.common.Constants.e_PosTopLeft and this should be one of these values.
  [in] | offset_x | Horizontal offset, in points.
  [in] | offset_y | Vertical offset, in points.
  [in] | flags | Watermark flags. Please refer to values starting from com.foxit.sdk.pdf.WatermarkSettings.e_FlagASPageContents and this can be one or a combination of these values.
  [in] | scale_x | Horizontal scale coefficient. It should be greater than 0.001f.
  [in] | scale_y | Vertical scale coefficient. It should be greater than 0.001f.
  [in] | rotation | Rotation angle in degrees.
  [in] | opacity | Opacity in percents. Valid range: from 0 to 100. 0 for fully transparent and 100 for fully opaque.

Returns
  None.

## ◆ setFlags()

com.foxit.sdk.pdf.WatermarkSettings.setFlags | ( | int | value | ) |

Set watermark flags.

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

Parameters

  [in] | value | Watermark flags.

Returns
  None.

## ◆ setOffset_x()

com.foxit.sdk.pdf.WatermarkSettings.setOffset_x | ( | float | value | ) |

Set horizontal offset, in points.

Parameters

  [in] | value | Horizontal offset, in points.

Returns
  None.

## ◆ setOffset_y()

com.foxit.sdk.pdf.WatermarkSettings.setOffset_y | ( | float | value | ) |

Set vertical offset, in points.

Parameters

  [in] | value | Vertical offset, in points.

Returns
  None.

## ◆ setOpacity()

com.foxit.sdk.pdf.WatermarkSettings.setOpacity | ( | int | value | ) |

Set opacity in percents.

Parameters

  [in] | value | Opacity in percents. Valid range: from 0 to 100. 0 for fully transparent and 100 for fully opaque.

Returns
  None.

## ◆ setPosition()

com.foxit.sdk.pdf.WatermarkSettings.setPosition | ( | int | value | ) |

Set watermark position.

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

Parameters

  [in] | value | Watermark position.

Returns
  None.

## ◆ setRotation()

com.foxit.sdk.pdf.WatermarkSettings.setRotation | ( | float | value | ) |

Set rotation angle in degrees.

Parameters

  [in] | value | Rotation angle in degrees.

Returns
  None.

## ◆ setScale_x()

com.foxit.sdk.pdf.WatermarkSettings.setScale_x | ( | float | value | ) |

Set horizontal scale coefficient.

Parameters

  [in] | value | Horizontal scale coefficient. It should be greater than 0.001f.

Returns
  None.

## ◆ setScale_y()

com.foxit.sdk.pdf.WatermarkSettings.setScale_y | ( | float | value | ) |

Set vertical scale coefficient.

Parameters

  [in] | value | Vertical scale coefficient. It should be greater than 0.001f.

Returns
  None.