Show / Hide Table of Contents

# Class TextStyledElement

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

##### Inheritance

object
TextStyledElement

##### Implements

IDisposable

##### Inherited Members

object.ToString()
object.Equals(object)
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetHashCode()
object.GetType()

###### Namespace: pdftron.Layout

###### Assembly: PDFNet.dll

##### Syntax

    public sealed class TextStyledElement : IDisposable

### Methods

#### Dispose()

##### Declaration

    public override sealed void Dispose()

#### Dispose(bool)

##### Declaration

    [HandleProcessCorruptedStateExceptions]
    protected void Dispose(bool A_0)

##### Parameters

Type | Name | Description
--- | --- | ---
bool | A_0 |

#### ~TextStyledElement()

##### Declaration

    protected ~TextStyledElement()

#### GetBackgroundColor(byte*)

Get background color for the style

##### Declaration

    public void GetBackgroundColor(byte* rgb)

##### Parameters

Type | Name | Description
--- | --- | ---
byte* | rgb | The color values are returned as an array of 3 integers in the range * 0 to 255, inclusive

#### GetFontFace()

Get the font face name used for the style

##### Declaration

    public string GetFontFace()

##### Returns

Type | Description
--- | ---
string | the font face name used for the style

#### GetFontSize()

Get the font size of the style

##### Declaration

    public double GetFontSize()

##### Returns

Type | Description
--- | ---
double | The font size of the style

#### GetTextColor(byte*)

Get text color for the style

##### Declaration

    public void GetTextColor(byte* rgb)

##### Parameters

Type | Name | Description
--- | --- | ---
byte* | rgb | The color values are returned as an array of 3 integers in the range * 0 to 255, inclusive

#### IsBold()

Get the bold setting of the style

##### Declaration

    public bool IsBold()

##### Returns

Type | Description
--- | ---
bool | true if the style is set as 'Bold'

#### IsItalic()

Get the italic setting of the style

##### Declaration

    public bool IsItalic()

##### Returns

Type | Description
--- | ---
bool | true if the style is set as 'Italic'

#### SetBackgroundColor(byte, byte, byte)

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

##### Declaration

    public void SetBackgroundColor(byte red, byte green, byte blue)

##### Parameters

Type | Name | Description
--- | --- | ---
byte | red | The red component of the text color
byte | green | The green component of the text color
byte | blue | The blue component of the text color

#### SetBold(bool)

Set or unset the style as 'Bold'

##### Declaration

    public void SetBold(bool val)

##### Parameters

Type | Name | Description
--- | --- | ---
bool | val | use true to set the style as 'Bold'

#### SetFontFace(string)

Set the font face name to be used for the style

##### Declaration

    public void SetFontFace(string fontface)

##### Parameters

Type | Name | Description
--- | --- | ---
string | fontface | The font face name to use for the style

#### SetFontSize(double)

Set font size of the style

##### Declaration

    public void SetFontSize(double fontsize)

##### Parameters

Type | Name | Description
--- | --- | ---
double | fontsize | The font size to use for the style

#### SetItalic(bool)

Set or unset the style as 'Italic'

##### Declaration

    public void SetItalic(bool val)

##### Parameters

Type | Name | Description
--- | --- | ---
bool | val | use true to set the style as 'Italic'

#### SetTextColor(byte, byte, byte)

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

##### Declaration

    public void SetTextColor(byte red, byte green, byte blue)

##### Parameters

Type | Name | Description
--- | --- | ---
byte | red | The red component of the text color
byte | green | The green component of the text color
byte | blue | The blue component of the text color

### Implements

IDisposable