# WordFinder Class

> A class used to extract words from a document.

- Product: Adobe PDF Library 21
- Language: .NET Framework
- Version: APDFL21.0.0PlusP1e
- HTML page: https://docs.datalogics.com/apdfl21/DotNetFramework/APDFL21.0.0PlusP1e/class/WordFinder
- Version index: https://docs.datalogics.com/apdfl21/DotNetFramework/APDFL21.0.0PlusP1e/llms.txt

```csharp
class WordFinder : SystemIDisposable
```

**Namespace:** `Datalogics::PDFL`

**Inherits from:** `SystemIDisposable`

## Description

A class used to extract words from a document.

**Referenced by:** [`WordProc`](https://docs.datalogics.com/apdfl21/DotNetFramework/APDFL21.0.0PlusP1e/class/WordProc.md)

**Uses types:** [`Document`](https://docs.datalogics.com/apdfl21/DotNetFramework/APDFL21.0.0PlusP1e/class/Document.md), [`Word`](https://docs.datalogics.com/apdfl21/DotNetFramework/APDFL21.0.0PlusP1e/class/Word.md), [`WordFinderConfig`](https://docs.datalogics.com/apdfl21/DotNetFramework/APDFL21.0.0PlusP1e/class/WordFinderConfig.md), [`WordFinderVersion`](https://docs.datalogics.com/apdfl21/DotNetFramework/APDFL21.0.0PlusP1e/enum/WordFinderVersion.md), [`WordProc`](https://docs.datalogics.com/apdfl21/DotNetFramework/APDFL21.0.0PlusP1e/class/WordProc.md)

## Constructors

### WordFinder

```csharp
Datalogics.PDFL.WordFinder.WordFinder(Document doc, WordFinderVersion algVersion, WordFinderConfig wbConfig)
```

*constructor*

**Parameters**

- `doc` ([`Document`](https://docs.datalogics.com/apdfl21/DotNetFramework/APDFL21.0.0PlusP1e/class/Document.md)): document in which to find words
- `algVersion` ([`WordFinderVersion`](https://docs.datalogics.com/apdfl21/DotNetFramework/APDFL21.0.0PlusP1e/enum/WordFinderVersion.md)): algorithm version to use
- `wbConfig` ([`WordFinderConfig`](https://docs.datalogics.com/apdfl21/DotNetFramework/APDFL21.0.0PlusP1e/class/WordFinderConfig.md)): configuration for this word finder

Create a word finder

## Methods

### Dispose

```csharp
void Datalogics.PDFL.WordFinder.Dispose()
```

**Returns:** `void`

### EnumWords

```csharp
bool Datalogics.PDFL.WordFinder.EnumWords(int pageNum, WordProc wordProc)
```

**Parameters**

- `pageNum` (`int`): The page number from which to extract words. Pass AllPages to sequentially process all pages in the document.
- `wordProc` ([`WordProc`](https://docs.datalogics.com/apdfl21/DotNetFramework/APDFL21.0.0PlusP1e/class/WordProc.md)): A user-supplied callback to call once for each word found. Enumeration halts if wordProc returns false.

**Returns:** `bool`

true if enumeration was successfully completed, false if enumeration was terminated because wordProc returned false.

Extracts words, one at a time, from the specified page or the entire document. It calls a user-supplied procedure once for each word found.

Only words within or partially within the page's crop box (see Page.CropBox) are enumerated. Words outside the crop box are skipped.

Word objects passed to wordProc become invalid once the call to EnumWords returns, or if the page number changes between calls to the WordProc.

**Exceptions**

- `genErrBadParm`: is raised if wordProc is NULL, or pageNum is less than zero or greater than the total number of pages in the document.
- `pdErrOpNotPermitted`

### GetVisibleWordList

```csharp
System.Collections.Generic.IList< Word > Datalogics.PDFL.WordFinder.GetVisibleWordList(int pageNum)
```

**Parameters**

- `pageNum` (`int`): the page number for which to get the list of words.

**Returns:** [`System.Collections.Generic.IList< Word >`](https://docs.datalogics.com/apdfl21/DotNetFramework/APDFL21.0.0PlusP1e/class/Word.md)

a list of x, y sorted words on the specified page.

Finds all Visible words on the specified page and returns a list containing the words. The words are sorted by their x- and y-coordinates on the page.

### GetWordList

```csharp
System.Collections.Generic.IList< Word > Datalogics.PDFL.WordFinder.GetWordList(int pageNum)
```

**Parameters**

- `pageNum` (`int`): the page number for which to get the list of words.

**Returns:** [`System.Collections.Generic.IList< Word >`](https://docs.datalogics.com/apdfl21/DotNetFramework/APDFL21.0.0PlusP1e/class/Word.md)

a list of x, y sorted words on the specified page.

Finds all words on the specified page and returns a list containing the words. The words are sorted by their x- and y-coordinates on the page.
