Foxit PDF SDK

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

## Public Member Functions
| RichTextStyle ()
| Constructor.
| RichTextStyle (Font font, float text_size, int text_alignment, long text_color, boolean is_bold, boolean is_italic, boolean is_underline, boolean is_strikethrough, int mark_style, float char_space, float word_space)
| Constructor, with parameters. More...
| RichTextStyle (RichTextStyle style)
| Constructor, with another style object. More...
synchronized void | delete ()
| Clean up related C++ resources immediately. More...
float | getChar_space ()
| Get the char space. More...
Font | getFont ()
| Get a font used in rich text style. More...
boolean | getIs_bold ()
| Get a boolean value which indicates whether to make text bold or not. More...
boolean | getIs_italic ()
| Get a boolean value which indicates whether to italicize text or not. More...
boolean | getIs_strikethrough ()
| Get a boolean value which indicates whether to cross text out with strike through or not. More...
boolean | getIs_underline ()
| Get a boolean value which indicates whether to underline text or not. More...
int | getMark_style ()
| Get corner mark style. More...
int | getText_alignment ()
| Get alignment value. More...
long | getText_color ()
| Get text color. More...
float | getText_size ()
| Get text size. More...
float | getWord_space ()
| Get the word space. More...
void | set (Font font, float text_size, int text_alignment, long text_color, boolean is_bold, boolean is_italic, boolean is_underline, boolean is_strikethrough, int mark_style, float char_space, float word_space)
| Set value. More...
void | setChar_space (float value)
| Set the char space. More...
void | setFont (Font value)
| Set a font used in rich text style. More...
void | setIs_bold (boolean value)
| Set a boolean value which indicates whether to make text bold or not. More...
void | setIs_italic (boolean value)
| Set a boolean value which indicates whether to italicize text or not. More...
void | setIs_strikethrough (boolean value)
| Set a boolean value which indicates whether to cross text out with strike through or not. More...
void | setIs_underline (boolean value)
| Set a boolean value which indicates whether to underline text or not. More...
void | setMark_style (int value)
| Set corner mark style. More...
void | setText_alignment (int value)
| Set alignment value. More...
void | setText_color (long value)
| Set text color. More...
void | setText_size (float value)
| Set text size. More...
void | setWord_space (float value)
| Set the word space. More...

## Static Public Attributes
static final int | e_CornerMarkNone = 1
| Corner mark style: none.
static final int | e_CornerMarkSubscript = 3
| Corner mark style: subscript.
static final int | e_CornerMarkSuperscript = 2
| Corner mark style: superscript.

## Detailed Description

This class represents rich text style data, which is used to specify the style of rich text.

## Constructor & Destructor Documentation

## ◆ RichTextStyle() [1/2]

com.foxit.sdk.pdf.annots.RichTextStyle.RichTextStyle | ( | Font | font,
|  | float | text_size,
|  | int | text_alignment,
|  | long | text_color,
|  | boolean | is_bold,
|  | boolean | is_italic,
|  | boolean | is_underline,
|  | boolean | is_strikethrough,
|  | int | mark_style,
|  | float | char_space,
|  | float | word_space
| ) |  |

Constructor, with parameters.

Parameters

  [in] | font | A valid font object.
  [in] | text_size | Text size. It should not be negative value. 0 means text will not be shown.
  [in] | text_alignment | Alignment value. Please refer to values starting from com.foxit.sdk.common.Constants.e_AlignmentLeft and this should be one of these values.
  [in] | text_color | Text color. Format: 0xRRGGBB.
  [in] | is_bold | A boolean value which indicates whether to make text bold or not.
  [in] | is_italic | A boolean value which indicates whether to italicize text or not.
  [in] | is_underline | A boolean value which indicates whether to underline text or not.
  [in] | is_strikethrough | A boolean value which indicates whether to cross text out with strike through or not.
  [in] | mark_style | Corner mark style which can be used to make text as superscript or subscript or not as any kind of corner mark. Please refer to values starting from com.foxit.sdk.pdf.annots.RichTextStyle.e_CornerMarkNone and this should be one of these values.
  [in] | char_space | The char space. It should not be negative value for table generator. It is only used in pdf.PDFPage.addText and table generator.
  [in] | word_space | The word space. It should not be negative value for table generator. It is only used in pdf.PDFPage.addText and table generator.

## ◆ RichTextStyle() [2/2]

com.foxit.sdk.pdf.annots.RichTextStyle.RichTextStyle | ( | RichTextStyle | style | ) |

Constructor, with another style object.

Parameters

  [in] | style | Another style object.

## Member Function Documentation

## ◆ delete()

synchronized void com.foxit.sdk.pdf.annots.RichTextStyle.delete | ( |  | ) |

Clean up related C++ resources immediately.

Returns
  None.

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

## ◆ getChar_space()

com.foxit.sdk.pdf.annots.RichTextStyle.getChar_space | ( |  | ) |

Get the char space.

Returns
  The char space. It should not be negative value for table generator. It is only used in pdf.PDFPage.addText .

## ◆ getFont()

com.foxit.sdk.pdf.annots.RichTextStyle.getFont | ( |  | ) |

Get a font used in rich text style.

- When current style is used to set a rich text or add/insert a new rich text, this font means "user expects to use this font for a rich text". Then during resetting appearance process, Foxit PDF SDK will check if the expected font is suitable and decide to use it or change to a more suitable font for showing text content.
- When current style is retrieved from a rich text, this font represents the used font of a rich text.

Returns
  A font used in rich text style. It should be a valid font object.

## ◆ getIs_bold()

com.foxit.sdk.pdf.annots.RichTextStyle.getIs_bold | ( |  | ) |

Get a boolean value which indicates whether to make text bold or not.

Returns
  A boolean value which indicates whether to make text bold or not.

## ◆ getIs_italic()

com.foxit.sdk.pdf.annots.RichTextStyle.getIs_italic | ( |  | ) |

Get a boolean value which indicates whether to italicize text or not.

Returns
  A boolean value which indicates whether to italicize text or not.

## ◆ getIs_strikethrough()

com.foxit.sdk.pdf.annots.RichTextStyle.getIs_strikethrough | ( |  | ) |

Get a boolean value which indicates whether to cross text out with strike through or not.

Returns
  A boolean value which indicates whether to cross text out with strike through or not.

## ◆ getIs_underline()

com.foxit.sdk.pdf.annots.RichTextStyle.getIs_underline | ( |  | ) |

Get a boolean value which indicates whether to underline text or not.

Returns
  A boolean value which indicates whether to underline text or not.

## ◆ getMark_style()

com.foxit.sdk.pdf.annots.RichTextStyle.getMark_style | ( |  | ) |

Get corner mark style.

Returns
  Corner mark style. Corner mark style which can be used to make text as superscript or subscript or not as any kind of corner mark. Please refer to values starting from com.foxit.sdk.pdf.annots.RichTextStyle.e_CornerMarkNone and this should be one of these values.

## ◆ getText_alignment()

com.foxit.sdk.pdf.annots.RichTextStyle.getText_alignment | ( |  | ) |

Get alignment value.

Returns
  Alignment value. Please refer to values starting from com.foxit.sdk.common.Constants.e_AlignmentLeft and this should be one of these values.

## ◆ getText_color()

com.foxit.sdk.pdf.annots.RichTextStyle.getText_color | ( |  | ) |

Get text color.

Returns
  Text color. Format: 0xRRGGBB.

## ◆ getText_size()

com.foxit.sdk.pdf.annots.RichTextStyle.getText_size | ( |  | ) |

Get text size.

Returns
  Text size. It should not be negative value. 0 means text will not be shown.

## ◆ getWord_space()

com.foxit.sdk.pdf.annots.RichTextStyle.getWord_space | ( |  | ) |

Get the word space.

Returns
  The word space. It should not be negative value for table generator. It is only used in pdf.PDFPage.addText .

## ◆ set()

void com.foxit.sdk.pdf.annots.RichTextStyle.set | ( | Font | font,
|  | float | text_size,
|  | int | text_alignment,
|  | long | text_color,
|  | boolean | is_bold,
|  | boolean | is_italic,
|  | boolean | is_underline,
|  | boolean | is_strikethrough,
|  | int | mark_style,
|  | float | char_space,
|  | float | word_space
| ) |  |

Set value.

Parameters

  [in] | font | A valid font object.
  [in] | text_size | Text size. It should not be negative value. 0 means text will not be shown.
  [in] | text_alignment | Alignment value. Please refer to values starting from com.foxit.sdk.common.Constants.e_AlignmentLeft and this should be one of these values.
  [in] | text_color | Text color. Format: 0xRRGGBB.
  [in] | is_bold | A boolean value which indicates whether to make text bold or not.
  [in] | is_italic | A boolean value which indicates whether to italicize text or not.
  [in] | is_underline | A boolean value which indicates whether to underline text or not.
  [in] | is_strikethrough | A boolean value which indicates whether to cross text out with strike through or not.
  [in] | mark_style | Corner mark style which can be used to make text as superscript or subscript or not as any kind of corner mark. Please refer to values starting from com.foxit.sdk.pdf.annots.RichTextStyle.e_CornerMarkNone and this should be one of these values.
  [in] | char_space | The char space. It should not be negative value for table generator. It is only used in pdf.PDFPage.addText .
  [in] | word_space | The word space. It should not be negative value for table generator. It is only used in pdf.PDFPage.addText .

Returns
  None.

## ◆ setChar_space()

com.foxit.sdk.pdf.annots.RichTextStyle.setChar_space | ( | float | value | ) |

Set the char space.

Parameters

  [in] | value | The char space. It should not be negative value for table generator. It is only used in pdf.PDFPage.addText .

Returns
  None.

## ◆ setFont()

com.foxit.sdk.pdf.annots.RichTextStyle.setFont | ( | Font | value | ) |

Set a font used in rich text style.

- When current style is used to set a rich text or add/insert a new rich text, this font means "user expects to use this font for a rich text". Then during resetting appearance process, Foxit PDF SDK will check if the expected font is suitable and decide to use it or change to a more suitable font for showing text content.
- When current style is retrieved from a rich text, this font represents the used font of a rich text.

Parameters

  [in] | value | A font used in rich text style. It should be a valid font object.

Returns
  None.

## ◆ setIs_bold()

com.foxit.sdk.pdf.annots.RichTextStyle.setIs_bold | ( | boolean | value | ) |

Set a boolean value which indicates whether to make text bold or not.

Parameters

  [in] | value | A boolean value which indicates whether to make text bold or not.

Returns
  None.

## ◆ setIs_italic()

com.foxit.sdk.pdf.annots.RichTextStyle.setIs_italic | ( | boolean | value | ) |

Set a boolean value which indicates whether to italicize text or not.

Parameters

  [in] | value | A boolean value which indicates whether to italicize text or not.

Returns
  None.

## ◆ setIs_strikethrough()

com.foxit.sdk.pdf.annots.RichTextStyle.setIs_strikethrough | ( | boolean | value | ) |

Set a boolean value which indicates whether to cross text out with strike through or not.

Parameters

  [in] | value | A boolean value which indicates whether to cross text out with strike through or not.

Returns
  None.

## ◆ setIs_underline()

com.foxit.sdk.pdf.annots.RichTextStyle.setIs_underline | ( | boolean | value | ) |

Set a boolean value which indicates whether to underline text or not.

Parameters

  [in] | value | A boolean value which indicates whether to underline text or not.

Returns
  None.

## ◆ setMark_style()

com.foxit.sdk.pdf.annots.RichTextStyle.setMark_style | ( | int | value | ) |

Set corner mark style.

Parameters

  [in] | value | Corner mark style. Corner mark style which can be used to make text as superscript or subscript or not as any kind of corner mark. Please refer to values starting from com.foxit.sdk.pdf.annots.RichTextStyle.e_CornerMarkNone and this should be one of these values.

Returns
  None.

## ◆ setText_alignment()

com.foxit.sdk.pdf.annots.RichTextStyle.setText_alignment | ( | int | value | ) |

Set alignment value.

Parameters

  [in] | value | Alignment value. Please refer to values starting from com.foxit.sdk.common.Constants.e_AlignmentLeft and this should be one of these values.

Returns
  None.

## ◆ setText_color()

com.foxit.sdk.pdf.annots.RichTextStyle.setText_color | ( | long | value | ) |

Set text color.

Parameters

  [in] | value | Text color. Format: 0xRRGGBB.

Returns
  None.

## ◆ setText_size()

com.foxit.sdk.pdf.annots.RichTextStyle.setText_size | ( | float | value | ) |

Set text size.

Parameters

  [in] | value | Text size. It should not be negative value. 0 means text will not be shown.

Returns
  None.

## ◆ setWord_space()

com.foxit.sdk.pdf.annots.RichTextStyle.setWord_space | ( | float | value | ) |

Set the word space.

Parameters

  [in] | value | The word space. It should not be negative value for table generator. It is only used in pdf.PDFPage.addText .

Returns
  None.