'We assume that the GdViewer1 control has been properly integrated
'and your document has been properly displayed as well.
'Setting some custom properties for the rectangle of selection.
GdViewer1.RectBorderColor = GdViewer1.ARGB(255, 69, 0)
GdViewer1.RectBorderSize = 2
If GdViewer1.SelectAllText() = GdPictureStatus.OK Then
Dim regions As RectangleF() = GdViewer1.GetSelectedTextRegions()
If (GdViewer1.GetStat() = GdPictureStatus.OK) AndAlso (regions.Count() > 0) Then
'The first region surely exists.
Dim rect As RectangleF = regions.ElementAt(0)
GdViewer1.SetRectCoordinatesOnDocumentInches(rect.Left, rect.Top, rect.Width, rect.Height)
GdViewer1.CenterOnRect()
Else
MessageBox.Show("The text region can't be found. Status: " + GdViewer1.GetStat().ToString(), "GdViewer.SetRectCoordinatesOnDocumentInches")
End If
Else
MessageBox.Show("The text can't be selected. Status: " + GdViewer1.GetStat().ToString(), "GdViewer.SetRectCoordinatesOnDocumentInches")
End If
//We assume that the GdViewer1 control has been properly integrated
//and your document has been properly displayed as well.
//Setting some custom properties for the rectangle of selection.
GdViewer1.RectBorderColor = GdViewer1.ARGB(255, 69, 0);
GdViewer1.RectBorderSize = 2;
if (GdViewer1.SelectAllText() == GdPictureStatus.OK)
{
RectangleF[] regions = GdViewer1.GetSelectedTextRegions();
if ((GdViewer1.GetStat() == GdPictureStatus.OK) && (regions.Count() > 0))
{
//The first region surely exists.
RectangleF rect = regions.ElementAt(0);
GdViewer1.SetRectCoordinatesOnDocumentInches(rect.Left, rect.Top, rect.Width, rect.Height);
GdViewer1.CenterOnRect();
}
else
MessageBox.Show("The text region can't be found. Status: " + GdViewer1.GetStat().ToString(), "GdViewer.SetRectCoordinatesOnDocumentInches");
}
else
MessageBox.Show("The text can't be selected. Status: " + GdViewer1.GetStat().ToString(), "GdViewer.SetRectCoordinatesOnDocumentInches");