Show / Hide Table of Contents

# Class TextExtractor.Style

A class representing predominant text style associated with a given Line, a Word, or a Glyph. The class includes information about the font, font size, font styles, text color, etc.

##### Inheritance

object
TextExtractor.Style

##### Implements

IDisposable

##### Inherited Members

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

###### Namespace: pdftron.PDF

###### Assembly: PDFNet.dll

##### Syntax

    public class TextExtractor.Style : IDisposable

### Constructors

#### Style()

##### Declaration

    public Style()

### Methods

#### Dispose()

Releases all resources used by the Style

##### Declaration

    public override sealed void Dispose()

#### Dispose(bool)

##### Declaration

    [HandleProcessCorruptedStateExceptions]
    protected virtual void Dispose(bool A_0)

##### Parameters

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

#### Equals(object)

Checks whether this `Style` object is the same as the opject specified.

##### Declaration

    public bool Equals(object o)

##### Parameters

Type | Name | Description
--- | --- | ---
object | o | another object

##### Returns

Type | Description
--- | ---
bool | true if equals specified object

#### ~Style()

##### Declaration

    protected ~Style()

#### GetColor()

Gets the color.

##### Declaration

    public Color GetColor()

##### Returns

Type | Description
--- | ---
Color | text color in RGB color space.

#### GetFont()

Gets the font.

##### Declaration

    public Obj GetFont()

##### Returns

Type | Description
--- | ---
Obj | low-level PDF font object. A high level font object can be instantiated as follows: pdftron.PDF.Font f = new pdftron.PDF.Font(style.getFont());

#### GetFontName()

Gets the font name.

##### Declaration

    public string GetFontName()

##### Returns

Type | Description
--- | ---
string | the font name used to draw the selected text.

#### GetFontSize()

Gets the font size.

##### Declaration

    public double GetFontSize()

##### Returns

Type | Description
--- | ---
double | The font size used to draw the selected text as it appears on the output page.

##### Remarks

Unlike the 'font size' in the graphics state (pdftron.PDF.GState) the returned font size accounts for the effects CTM, text matrix, and other graphics state attributes that can affect the appearance of text.

#### GetWeight()

Gets the weight.

##### Declaration

    public int GetWeight()

##### Returns

Type | Description
--- | ---
int | The weight (thickness) component of the fully-qualified font name or font specifier. The possible values are 100, 200, 300, 400, 500, 600, 700, 800, or 900, where each number indicates a weight that is at least as dark as its predecessor. A value of 400 indicates a normal weight; 700 indicates bold. Note: The specific interpretation of these values varies from font to font. For example, 300 in one font may appear most similar to 500 in another.

#### IsItalic()

Checks if is italic.

##### Declaration

    public bool IsItalic()

##### Returns

Type | Description
--- | ---
bool | true if glyphs have dominant vertical strokes that are slanted.

##### Remarks

the return value corresponds to the state of 'italic' flag in the 'Font Descriptor'.

#### IsSerif()

Checks if is serif.

##### Declaration

    public bool IsSerif()

##### Returns

Type | Description
--- | ---
bool | true if glyphs have serifs, which are short strokes drawn at an angle on the top and bottom of glyph stems.

##### Remarks

the return value corresponds to the state of 'serif' flag in the 'Font Descriptor'.

#### Set(Style)

Sets value to the specified `Style`

##### Declaration

    public void Set(TextExtractor.Style r)

##### Parameters

Type | Name | Description
--- | --- | ---
TextExtractor.Style | r | specified `Style` object

#### op_Assign(Style)

Assignment operator

##### Declaration

    public TextExtractor.Style op_Assign(TextExtractor.Style r)

##### Parameters

Type | Name | Description
--- | --- | ---
TextExtractor.Style | r | specified `Style` object

##### Returns

Type | Description
--- | ---
TextExtractor.Style | a `Style` object equals to the specified object

### Operators

#### operator ==(Style, Style)

Equality operator check whether two `Style` objects are the same.

##### Declaration

    public static bool operator ==(TextExtractor.Style l, TextExtractor.Style r)

##### Parameters

Type | Name | Description
--- | --- | ---
TextExtractor.Style | l | object at the left of the operator
TextExtractor.Style | r | object at the right of the operator

##### Returns

Type | Description
--- | ---
bool | true if both objects are equal, false otherwise

#### operator !=(Style, Style)

Inequality operator check whether two `Style` objects are different.

##### Declaration

    public static bool operator !=(TextExtractor.Style l, TextExtractor.Style r)

##### Parameters

Type | Name | Description
--- | --- | ---
TextExtractor.Style | l | object at the left of the operator
TextExtractor.Style | r | object at the right of the operator

##### Returns

Type | Description
--- | ---
bool | true if both objects are not equal, false otherwise

### Implements

IDisposable