'We assume that the GdViewer1 control has been properly integrated
'and your document has been properly displayed as well.
Sub MySearchText(ByVal TextToSearch As String)
Dim page As Integer = GdViewer1.CurrentPage, occurrence As Integer = 0
Dim status As GdPictureStatus = GdPictureStatus.OK
While (status = GdPictureStatus.OK) AndAlso (page <= GdViewer1.PageCount)
occurrence = GdViewer1.GetTextOccurrenceCount(page, TextToSearch, False, False)
status = GdViewer1.GetStat()
If status = GdPictureStatus.OK Then
If occurrence > 0 Then Exit While
page += 1
End If
End While
If (status = GdPictureStatus.OK) AndAlso (occurrence > 0) Then GdViewer1.DisplayPage(page)
End Sub
//We assume that the GdViewer1 control has been properly integrated
//and your document has been properly displayed as well.
void MySearchText(string TextToSearch)
{
int page = GdViewer1.CurrentPage, occurrence = 0;
GdPictureStatus status = GdPictureStatus.OK;
while ((status == GdPictureStatus.OK) && (page <= GdViewer1.PageCount))
{
occurrence = GdViewer1.GetTextOccurrenceCount(page, TextToSearch, false, false);
status = GdViewer1.GetStat();
if (status == GdPictureStatus.OK)
{
if (occurrence > 0) break;
page++;
}
}
if ((status == GdPictureStatus.OK) && (occurrence > 0))
GdViewer1.DisplayPage(page);
}