Back to Devexpress

PdfTextSearchResults.Status Property

officefileapi-devexpress-dot-pdf-dot-pdftextsearchresults-611d9615.md

latest6.1 KB
Original Source

PdfTextSearchResults.Status Property

Indicates the current text search operation status.

Namespace : DevExpress.Pdf

Assembly : DevExpress.Pdf.v25.2.Core.dll

NuGet Package : DevExpress.Pdf.Core

Declaration

csharp
public PdfTextSearchStatus Status { get; }
vb
Public ReadOnly Property Status As PdfTextSearchStatus

Property Value

TypeDescription
PdfTextSearchStatus

A PdfTextSearchStatus enumeration value.

|

Available values:

NameDescription
Found

The text, which is being searched for, has been found.

| | NotFound |

The text, which is being searched for, has not been found.

| | Finished |

The text search has finished.

|

The following code snippets (auto-collected from DevExpress Examples) contain references to the Status property.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

pdf-document-api-bookmark-search-results-in-document/CS/Destination/Program.cs#L31

csharp
// to be displayed at the upper corner of the window.
if (results.Status == PdfTextSearchStatus.Found) {
    PdfXYZDestination destination = new PdfXYZDestination(results.Page, 0, results.Rectangles[0].Top, null);

winforms-pdf-viewer-operate-pdf-content-at-runtime/CS/WindowsFormsApplication1/MainForm.cs#L42

csharp
documentProcessor.LoadDocument(filePath);
while (documentProcessor.FindText(word).Status == PdfTextSearchStatus.Found) {
    count++;

pdf-document-api-highlight-search-results/CS/HighlightSearchResults/Program.cs#L31

csharp
//Get the search results from the FindText method call with search text and search parameters
while ((result = documentProcessor.FindText(word, searchParameters)).Status == PdfTextSearchStatus.Found)
{

pdf-document-api-add-link-to-page/CS/AddLinkToPage/Program.cs#L24

csharp
// If the phrase is found, obtain its bounding rectangle
if (linkSearchResults.Status == PdfTextSearchStatus.Found)
{

pdf-document-api-add-link-to-uri/CS/AddLinkToUri/Program.cs#L22

csharp
if (linkSearchResults.Status == PdfTextSearchStatus.Found)
{

pdf-document-api-bookmark-search-results-in-document/VB/Destination/Program.vb#L26

vb
' to be displayed at the upper corner of the window.
If results.Status = DevExpress.Pdf.PdfTextSearchStatus.Found Then
    Dim destination As DevExpress.Pdf.PdfXYZDestination = New DevExpress.Pdf.PdfXYZDestination(results.Page, 0, results.Rectangles(CInt((0))).Top, Nothing)

winforms-pdf-viewer-operate-pdf-content-at-runtime/VB/WindowsFormsApplication1/MainForm.vb#L45

vb
documentProcessor.LoadDocument(filePath)
While documentProcessor.FindText(word).Status = PdfTextSearchStatus.Found
    count += 1

pdf-document-api-highlight-search-results/VB/HighlightSearchResults/Program.vb#L25

vb
'Get the search results from the FindText method call with search text and search parameters
Do While InlineAssignHelper(result, documentProcessor.FindText(word, searchParameters)).Status = PdfTextSearchStatus.Found
    'HighlightResultWithGraphics(documentProcessor, result)

pdf-document-api-add-link-to-page/VB/AddLinkToPage/Program.vb#L24

vb
' If the phrase is found, obtain its bounding rectangle
If linkSearchResults.Status = PdfTextSearchStatus.Found Then
    Dim linkRectangle As PdfRectangle = linkSearchResults.Rectangles(0).BoundingRectangle

pdf-document-api-add-link-to-uri/VB/AddLinkToUri/Program.vb#L21

vb
If linkSearchResults.Status = PdfTextSearchStatus.Found Then
    Dim linkRectangle As PdfRectangle = linkSearchResults.Rectangles(0).BoundingRectangle

See Also

PdfTextSearchResults Class

PdfTextSearchResults Members

DevExpress.Pdf Namespace