Find Method
- Namespace
TXTextControl.DocumentServer. PDF. Contents
- Package
TXTextControl.asTextControl. WinForms. SDK TXDocumentServer.from the private NuGet feed or Text Control Offline Packagesdll
Description
Performs a search in the DocumentServer.PDF.Contents.Lines.ContentLines list using a string value, a regular expression or by performing a search in a geometric location.
Syntax
Find(string)
Returns a list of DocumentServer.PDF.Contents.ContentLine found based on a string.
public List<ContentLine> Find(string text);Public Function Find(text As String) As List(Of ContentLine)| Parameter | Description |
|---|---|
| text | The string to search for in the document. |
Find(string, RegexOptions)
Returns a list of DocumentServer.PDF.Contents.ContentLine objects found through a regular expression.
public List<ContentLine> Find(string regex, RegexOptions options);Public Function Find(regex As String, options As RegexOptions) As List(Of ContentLine)| Parameter | Description |
|---|---|
| regex | The regular expression that is used in the find process. |
| options | The regular expression options. |
Find(PointF, float, bool)
Returns a list of DocumentServer.PDF.Contents.ContentLine objects at a geometric location with a given radius.
public List<ContentLine> Find(PointF position, float radius = 100f, bool partially = false);Public Function Find(position As PointF, Optional radius As Single = 100F, Optional partially As Boolean = False) As List(Of ContentLine)| Parameter | Description |
|---|---|
| position | The geometric location in the document to search for. |
| radius | The radius to define the search area. |
| partially | Specifies whether the lines have to be completely inside the given rectangle or just intersect with it. |
Find(RectangleF, bool)
Returns a list of DocumentServer.PDF.Contents.ContentLine objects in a given rectangle.
public List<ContentLine> Find(RectangleF rectangle, bool partially = false);Public Function Find(rectangle As RectangleF, Optional partially As Boolean = False) As List(Of ContentLine)| Parameter | Description |
|---|---|
| rectangle | The rectangle that is used for the find process. |
| partially | Specifies whether the lines have to be completely inside the given rectangle or just intersect with it. |
Return Value
Returns a list of DocumentServer.PDF.Contents.ContentLine objects that matches the find options.
Examples
The following example searches for text and handles the returned position.
var result = lines.Find("Quarterly report", System.Text.RegularExpressions.RegexOptions.IgnoreCase);
Console.WriteLine($"Find result: {result}");Dim result = lines.Find("Quarterly report", System.Text.RegularExpressions.RegexOptions.IgnoreCase)
Console.WriteLine($"Find result: {result}")