Foxit PDF SDK

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

## Public Member Functions
| WatermarkTextProperties ()
| Constructor.
| WatermarkTextProperties (Font font, float font_size, long color, int style, float line_space, int alignment)
| Constructor, with parameters. More...
| WatermarkTextProperties (WatermarkTextProperties properties)
| Constructor, with another watermark text properties object. More...
synchronized void | delete ()
| Clean up related C++ resources immediately. More...
int | getAlignment ()
| Get text horizontal alignment. More...
long | getColor ()
| Get text color. More...
Font | getFont ()
| Get a font object used for the text. More...
float | getFont_size ()
| Get font size in points. More...
int | getFont_style ()
| Get font style. More...
float | getLine_space ()
| Get space between vertical center of lines, in line heights. More...
void | set (Font font, float font_size, long color, int style, float line_space, int alignment)
| Set value. More...
void | setAlignment (int value)
| Set text horizontal alignment. More...
void | setColor (long value)
| Set text color. More...
void | setFont (Font value)
| Set a font object used for the text. More...
void | setFont_size (float value)
| Set font size in points. More...
void | setFont_style (int value)
| Set font style. More...
void | setLine_space (float value)
| Set space between vertical center of lines, in line heights. More...

## Static Public Attributes
static final int | e_FontStyleNormal = 0
| Watermark font style: normal.
static final int | e_FontStyleUnderline = 1
| Watermark font style: with underline.

## Detailed Description

This class represents the watermark text settings used to construct a watermark object from text.

## Constructor & Destructor Documentation

## ◆ WatermarkTextProperties() [1/2]

com.foxit.sdk.pdf.WatermarkTextProperties.WatermarkTextProperties | ( | Font | font,
|  | float | font_size,
|  | long | color,
|  | int | style,
|  | float | line_space,
|  | int | alignment
| ) |  |

Constructor, with parameters.

The parameters line_space and alignment don't support tiled watermark, and will have no effect after setting.

Parameters

  [in] | font | A valid font object used for the text.
  [in] | font_size | Font size in points.
  [in] | color | Text color. Format: 0xRRGGBB.
  [in] | style | Font style. It should be one of the following values: com.foxit.sdk.pdf.WatermarkTextProperties.e_FontStyleNormal com.foxit.sdk.pdf.WatermarkTextProperties.e_FontStyleUnderline
  [in] | line_space | Space between vertical center of lines, in line heights. This value specifies the multiple of line heights for the space between vertical center of lines. Valid range: from 0 to 10 (not including 0 but including 10). If this value is above 10, 10 will be used as default for the text watermark.
  [in] | alignment | Text horizontal alignment. It should be one of the following values: com.foxit.sdk.common.Constants.e_AlignmentLeft com.foxit.sdk.common.Constants.e_AlignmentCenter com.foxit.sdk.common.Constants.e_AlignmentRight

## ◆ WatermarkTextProperties() [2/2]

com.foxit.sdk.pdf.WatermarkTextProperties.WatermarkTextProperties | ( | WatermarkTextProperties | properties | ) |

Constructor, with another watermark text properties object.

Parameters

  [in] | properties | Another watermark text properties object.

## Member Function Documentation

## ◆ delete()

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

Clean up related C++ resources immediately.

Returns
  None.

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

## ◆ getAlignment()

com.foxit.sdk.pdf.WatermarkTextProperties.getAlignment | ( |  | ) |

Get text horizontal alignment.

It should be one of the following macro definitions:

- com.foxit.sdk.common.Constants.e_AlignmentLeft
- com.foxit.sdk.common.Constants.e_AlignmentCenter
- com.foxit.sdk.common.Constants.e_AlignmentRight

Returns
  Text horizontal alignment. The default value is com.foxit.sdk.common.Constants.e_AlignmentLeft .

## ◆ getColor()

com.foxit.sdk.pdf.WatermarkTextProperties.getColor | ( |  | ) |

Get text color.

Returns
  Text color. Format: 0xRRGGBB. The default value is 0x000000.

## ◆ getFont()

com.foxit.sdk.pdf.WatermarkTextProperties.getFont | ( |  | ) |

Get a font object used for the text.

Returns
  A font object used for the text.

## ◆ getFont_size()

com.foxit.sdk.pdf.WatermarkTextProperties.getFont_size | ( |  | ) |

Get font size in points.

Returns
  Font size in points. The default value is 24.0.

## ◆ getFont_style()

com.foxit.sdk.pdf.WatermarkTextProperties.getFont_style | ( |  | ) |

Get font style.

It should be one of the following values:

- com.foxit.sdk.pdf.WatermarkTextProperties.e_FontStyleNormal
- com.foxit.sdk.pdf.WatermarkTextProperties.e_FontStyleUnderline

Returns
  Font style.The default value is com.foxit.sdk.pdf.WatermarkTextProperties.e_FontStyleNormal .

## ◆ getLine_space()

com.foxit.sdk.pdf.WatermarkTextProperties.getLine_space | ( |  | ) |

Get space between vertical center of lines, in line heights.

This value is used to specify the multiple of line heights for the space between vertical center of lines. Valid range: from 0 to 10 (not including 0 but including 10). If this value is above 10, 10 will be used as default for the text watermark.

Returns
  Space between vertical center of lines, in line heights. The default value is 1.0.

## ◆ set()

void com.foxit.sdk.pdf.WatermarkTextProperties.set | ( | Font | font,
|  | float | font_size,
|  | long | color,
|  | int | style,
|  | float | line_space,
|  | int | alignment
| ) |  |

Set value.

The parameters line_space and alignment don't support tiled watermark, and will have no effect after setting.

Parameters

  [in] | font | A valid font object used for the text.
  [in] | font_size | Font size in points.
  [in] | color | Text color. Format: 0xRRGGBB.
  [in] | style | Font style. It should be one of the following values: com.foxit.sdk.pdf.WatermarkTextProperties.e_FontStyleNormal com.foxit.sdk.pdf.WatermarkTextProperties.e_FontStyleUnderline
  [in] | line_space | Space between vertical center of lines, in line heights. This value specifies the multiple of line heights for the space between vertical center of lines. Valid range: from 0 to 10 (not including 0 but including 10). If this value is above 10, 10 will be used as default for the text watermark.
  [in] | alignment | Text horizontal alignment. It should be one of the following values: com.foxit.sdk.common.Constants.e_AlignmentLeft com.foxit.sdk.common.Constants.e_AlignmentCenter com.foxit.sdk.common.Constants.e_AlignmentRight

Returns
  None.

## ◆ setAlignment()

com.foxit.sdk.pdf.WatermarkTextProperties.setAlignment | ( | int | value | ) |

Set text horizontal alignment.

It should be one of the following macro definitions:

- com.foxit.sdk.common.Constants.e_AlignmentLeft
- com.foxit.sdk.common.Constants.e_AlignmentCenter
- com.foxit.sdk.common.Constants.e_AlignmentRight

Parameters

  [in] | value | Text horizontal alignment. The default value is com.foxit.sdk.common.Constants.e_AlignmentLeft .

Returns
  None.

## ◆ setColor()

com.foxit.sdk.pdf.WatermarkTextProperties.setColor | ( | long | value | ) |

Set text color.

Parameters

  [in] | value | Text color. Format: 0xRRGGBB. The default value is 0x000000.

Returns
  None.

## ◆ setFont()

com.foxit.sdk.pdf.WatermarkTextProperties.setFont | ( | Font | value | ) |

Set a font object used for the text.

Parameters

  [in] | value | A font object used for the text.

Returns
  None.

## ◆ setFont_size()

com.foxit.sdk.pdf.WatermarkTextProperties.setFont_size | ( | float | value | ) |

Set font size in points.

Parameters

  [in] | value | Font size in points. The default value is 24.0.

Returns
  None.

## ◆ setFont_style()

com.foxit.sdk.pdf.WatermarkTextProperties.setFont_style | ( | int | value | ) |

Set font style.

It should be one of the following values:

- com.foxit.sdk.pdf.WatermarkTextProperties.e_FontStyleNormal
- com.foxit.sdk.pdf.WatermarkTextProperties.e_FontStyleUnderline

Parameters

  [in] | value | Font style.The default value is com.foxit.sdk.pdf.WatermarkTextProperties.e_FontStyleNormal .

Returns
  None.

## ◆ setLine_space()

com.foxit.sdk.pdf.WatermarkTextProperties.setLine_space | ( | float | value | ) |

Set space between vertical center of lines, in line heights.

This value is used to specify the multiple of line heights for the space between vertical center of lines. Valid range: from 0 to 10 (not including 0 but including 10). If this value is above 10, 10 will be used as default for the text watermark.

Parameters

  [in] | value | Space between vertical center of lines, in line heights. The default value is 1.0.

Returns
  None.