---
Product: Aspose.PDF
Platform: net
Page Type: reference
Canonical URL: https://reference.aspose.org/pdf/net/TextSearchOptions
---

# TextSearchOptions

## Overview

`TextSearchOptions` is a class in Aspose.PDF FOSS for .NET.

Options for text search operations in PDF documents.

This class provides 4 methods for working with TextSearchOptions objects in .NET programs.
Available methods include: `TextSearchOptions`.
All public members are accessible to any .NET application after installing the Aspose.PDF FOSS for .NET package.
Properties: `CaseSensitive`, `IgnoreResourceFontErrors`, `IgnoreShadowText`, `IsRegularExpression`, `IsRegularExpressionUsed`, `LimitToPageBounds`, and 7 more.

## Properties

| Name | Type | Access | Description |
|------|------|--------|-------------|
| `IsRegularExpression` | `bool` | Read/Write | Gets or sets whether the search phrase is a regular expression. |
| `CaseSensitive` | `bool` | Read/Write | Gets or sets whether the search is case-sensitive. |
| `WholeWord` | `bool` | Read/Write | Gets or sets whether to match whole words only. |
| `Rectangle` | `Rectangle?` | Read/Write | Gets or sets a rectangle to limit the text search area. |
| `IsRegularExpressionUsed` | `bool` | Read/Write | Alias for IsRegularExpression (matches .NET Aspose.PDF API). |
| `LimitToPageBounds` | `bool` | Read/Write | Gets or sets whether text search is limited to page boundaries. |
| `SearchForTextRelatedGraphics` | `bool` | Read/Write | Gets or sets whether text-search results should also collect graphics (lines, rectangles, fills) positionally related to the matched text — for example the underline of a hyperlink or the highlight rectangle around a phrase. |
| `IgnoreResourceFontErrors` | `bool` | Read/Write | When true, the absorber suppresses exceptions raised by malformed or missing font resources during page traversal — the offending text run is silently skipped instead of bubbling up. |
| `SearchInAnnotations` | `bool` | Read/Write | Whether annotation-bound text contributes to search results. |
| `IgnoreShadowText` | `bool` | Read/Write | Whether text drawn off-page or behind opaque shapes is ignored. |
| `UseFontEngineEncoding` | `bool` | Read/Write | Whether the font engine's encoding tables drive decoding instead of /ToUnicode. |
| `LogTextExtractionErrors` | `bool` | Read/Write | Whether text-extraction errors are routed through the document logger. |
| `StoredGraphicElementsMaxCount` | `int` | Read/Write | Maximum number of graphics elements retained by the absorber alongside matched text. |

## Methods

| Signature | Description |
|-----------|-------------|
| `TextSearchOptions()` | Initializes a new instance of the TextSearchOptions class. |
| `TextSearchOptions(isRegularExpressionUsed: bool)` | Initializes a new instance of the TextSearchOptions class with the specified regular expression mode. |
| `TextSearchOptions(rectangle: Rectangle)` | Initializes a new instance of the TextSearchOptions class constraining the search to a rectangle in page space. |
| `TextSearchOptions(rectangle: Rectangle, isRegularExpressionUsed: bool)` | Initializes a new instance constraining the search to a rectangle and optionally treating the phrase as a regular expression. |

## See Also

- [Aspose.PDF for .NET — Enterprise API Reference](https://reference.aspose.com/pdf/net/)