PdfViewer.SearchForward
Searches the string specified in forward direction.
public void SearchForward(string searchString, MatchOptions option)
Sub SearchForward(searchString As String, option As MatchOptions)
Parameters
- searchString
- String
The string to be searched.
- option
- MatchOptions
The match option to use for searching.
Licensing Info
This method is a DynamicPDF Viewer feature. One of the following is required for non-evaluation usage:
- An active DynamicPDF Subscription
- An active DynamicPDF Professional or Professional Plus Subscription with DynamicPDF Viewer selected.
- A DynamicPDF Viewer for .NET v3.X Developer license.
Examples
The following example will show how to search a sring in forward direction with match option.Imports System
Imports System.Windows.Forms
Imports ceTe.DynamicPDF.Viewer
Public Class Form1
Inherits System.Windows.Forms.Form
Private MyPdfViewer As PdfViewer
Sub New()
InitializeComponent()
End Sub
Private Sub InitializeComponent()
Me.MyPdfViewer = New PdfViewer()
Me.Controls.Add(MyPdfViewer)
End Sub
Shared Sub Main()
Application.Run(New Form1())
End Sub
Private Sub Search()
' Searches string in forward direction.
MyPdfViewer.SearchForward("string", MatchOptions.WholeWordOnly)
End Sub
End Class
using System;
using System.Windows.Forms;
using ceTe.DynamicPDF.Viewer;
namespace DynamicPDFViewerDemo
{
public class Form1 : Form
{
private ceTe.DynamicPDF.Viewer.PdfViewer dpdfViewer;
public Form1()
{
InitializeComponent();
}
[STAThread]
static void Main()
{
Application.Run(new Form1());
}
private void InitializeComponent()
{
this.dpdfViewer = new PdfViewer();
this.Controls.Add(dpdfViewer);
}
private void Search()
{
// Searches string in forward direction.
SearchForward("string" , MatchOptions.WholeWordOnly);
}
}
}
Remarks
Search starts with firing SearchProgressing event. During search, Searched event will be fired if any match is found. SearchProgressing event is fired each time with Status 'Progressing' when the search finishes the current page and moves to next page. When search completed Searched event will be fired with Status 'Completed'. If user cancels the existing search through user interface or through code by invoking a new search, then Searched event will be fired with Status 'Canceled'. Change in the search term, options, search direction or invoking a new search when current search is progressing, will result in resetting of the current search.