Show / Hide Table of Contents

# Class PDFViewWPF.Selection

Selection is a utility class that allows access to PDFViewCtrl's current selection.

##### Inheritance

object
PDFViewWPF.Selection

##### Implements

IDisposable

##### Inherited Members

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

###### Namespace: pdftron.PDF

###### Assembly: PDFNet.dll

##### Syntax

    public class PDFViewWPF.Selection : IDisposable

### Methods

#### Dispose()

##### Declaration

    public override sealed void Dispose()

#### Dispose(bool)

##### Declaration

    protected virtual void Dispose(bool A_0)

##### Parameters

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

#### GetAsHtml()

Gets the current text selection in HTML format. HTML text will contain styling information such as text color, font size, style etc.

##### Declaration

    public string GetAsHtml()

##### Returns

Type | Description
--- | ---
string | the current text selection in HTML format.

##### Remarks

this function can be used to implement clipboard copy and paste that preserves text formating.

#### GetAsUnicode()

Gets the current text selection represented as an Unicode string.

##### Declaration

    public string GetAsUnicode()

##### Returns

Type | Description
--- | ---
string | the current text selection represented as an Unicode string.

#### GetPageNum()

Gets the page number containing the selected text.

##### Declaration

    public int GetPageNum()

##### Returns

Type | Description
--- | ---
int | the page number containing the selected text.

#### GetQuads()

Gets the list of tight bounding quads in the current text selection.

##### Declaration

    public double[] GetQuads()

##### Returns

Type | Description
--- | ---
double[] | an array of vertices representing a list of bounding quads for the selected text. Each bounding quad is represented using 8 numbers in an array of doubles. Each two consecutive values represent the x and y coordinates of a quad vertex and the four vertices are arranged counter-clockwisely. Note that the first vertex is not guaranteed to be the lower-left vertex.

##### Remarks

the 'quads' array is owned by the current selection and does not need to be explicitly released.

### Implements

IDisposable