Summary: Methods | Inherited Methods | [Expand All]
public class

# TextStyledElement

extends ContentElement

java.lang.Object
↳ | com.pdftron.layout.ContentElement
| ↳ | com.pdftron.layout.TextStyledElement

## Class Overview

A TextStyledElement provides access to the text style properties of a `ContentElement`.

## Summary

Public Methods
static void | SetBackgroundColor(long self, int red, int green, int blue)
String | getFontFace() Get the font face name used for the style
double | getFontSize() Get the font size of the style
boolean | isBold() Get the bold setting of the style
boolean | isItalic() Get the italic setting of the style
void | setBackgroundColor(int red, int green, int blue) Sets the background color for the style.
void | setBold(boolean val) Set or unset the style as 'Bold'
void | setFontFace(String fontface) Set the font face name to be used for the style
void | setFontSize(double fontsize) Set font size of the style
void | setItalic(boolean val) Set or unset the style as 'italic'
void | setTextColor(int red, int green, int blue) Set text color for the style The color values must be between 0 and 255, otherwise an exception will be thrown.

[Expand] Inherited Methods
From class com.pdftron.layout.ContentElement
ContentNode | asContentNode() Retrieve the `ContentNode` object for this content element if it is a content node.
List | asList() Retrieve the `List` object for this content element if it is a list.
ListItem | asListItem() Retrieve the `ListItem` object for this content element if it is a list item.
Paragraph | asParagraph() Retrieve the `Paragraph` object for this content element if it is a paragraph.
Table | asTable() Retrieve the `Table` object for this content element if it is a table.
TableCell | asTableCell() Retrieve the `TableCell` object for this content element if it is a table cell.
TableRow | asTableRow() Retrieve the `TableRow` object for this content element if it is a table row.
TextRun | asTextRun() Retrieve the `TextRun` object for this content element if it is a text run.
TextStyledElement | getTextStyledElement() Retrieve the `TextStyledElement` object for manipulating the text style of this content element.
From class java.lang.Object
boolean | equals(Object arg0)
final Class<?> | getClass()
int | hashCode()
final void | notify()
final void | notifyAll()
String | toString()
final void | wait(long arg0, int arg1)
final void | wait(long arg0)
final void | wait()

## Public Methods

#### public static void SetBackgroundColor (long self, int red, int green, int blue)

##### Throws

PDFNetException |

#### public String getFontFace ()

Get the font face name used for the style

##### Returns

- the font face name used for the style

##### Throws

PDFNetException |

#### public double getFontSize ()

Get the font size of the style

##### Returns

- The font size of the style

##### Throws

PDFNetException |

#### public boolean isBold ()

Get the bold setting of the style

##### Returns

- true if the style is set as 'Bold'

##### Throws

PDFNetException |

#### public boolean isItalic ()

Get the italic setting of the style

##### Returns

- true if the style is set as 'Italic'

##### Throws

PDFNetException |

#### public void setBackgroundColor (int red, int green, int blue)

Sets the background color for the style.

##### Parameters

red | The red component of the background color.
green | The green component of the background color.
blue | The blue component of the background color.

##### Throws

PDFNetException |

#### public void setBold (boolean val)

Set or unset the style as 'Bold'

##### Parameters

val | use true to set the style as 'Bold'

##### Throws

PDFNetException |

#### public void setFontFace (String fontface)

Set the font face name to be used for the style

##### Parameters

fontface | The font face name to use for the style

##### Throws

PDFNetException |

#### public void setFontSize (double fontsize)

Set font size of the style

##### Parameters

fontsize | The font size to use for the style

##### Throws

PDFNetException |

#### public void setItalic (boolean val)

Set or unset the style as 'italic'

##### Parameters

val | use true to set the style as 'Italic'

##### Throws

PDFNetException |

#### public void setTextColor (int red, int green, int blue)

Set text color for the style The color values must be between 0 and 255, otherwise an exception will be thrown.

##### Parameters

red | The red component of the text color
green | The green component of the text color
blue | The blue component of the text color

##### Throws

IllegalArgumentException | if any of the color values is out of range
PDFNetException |