DocumentViewerFindTextStart Enumeration

Summary

An enumeration for selecting the starting position of a DocumentViewerText.Find operation.

Syntax
TypeScript
JavaScript
lt.Document.Viewer.DocumentViewerFindTextStart = { 
	beginPosition: 0, 
	inSelection: 1, 
	afterSelection: 2, 
	manualPosition: 3 
} 
lt.Document.Viewer.DocumentViewerFindTextStart = { 
	beginPosition: 0, 
	inSelection: 1, 
	afterSelection: 2, 
	manualPosition: 3 
} 

Members

0BeginPositionDefault. Indicates that the search should run from the provided DocumentViewerFindText.BeginPosition to the DocumentViewerFindText.EndPosition (or top of page 1 and bottom of the last page, if these values are null). This results in one total search from beginning to end.
1InSelectionSetting this value to DocumentViewerFindText.Start indicates that the search should begin at the first character inside the first text selection in the document. This position may be either DocumentViewerText.SelectedTextBegin or DocumentViewerText.SelectedTextEnd, depending on the direction of the search.

If no text is selected, DocumentViewerFindText.Start works like DocumentViewerFindTextStart.BeginPosition (the default).

If the text selection is within the bounds created by DocumentViewerFindText.BeginPosition and DocumentViewerFindText.EndPosition, this may result in two searches.

The first search will occur from the first character in the selection to the position indicated by DocumentViewerFindText.EndPosition. If the first character in the selection is before the beginPosition in the direction of the search, this means only one search is conducted, from the beginPosition to the endPosition. If the first character in the selection is after the endPosition in the direction of the search, no results will be returned.

If DocumentViewerFindText.Loop or DocumentViewerFindText.FindAll is set to true, then a second search may be conducted from the beginPosition to the character before the first character in the selection, provided that the first character in the selection was within the bounds of the search.

This behavior is similar to that in DocumentViewerFindTextStart.AfterSelection, but with the first character in the text selection instead of the character after the end of the selection. Effectively, DocumentViewerFindTextStart.InSelection will search the selection first, and DocumentViewerFindTextStart.AfterSelection will not.

When using DocumentViewerFindText.SelectFirstResult, searching from the first character of the selection may be useful for “live update” search actions that will continue to add on to the selected text as long as it continues to match DocumentViewerFindText.Text. For example, if “L” is the selected text from a previous search for “L”, and the rest of the text is -“ead”, then successive searches of “L”, “Le”, “Lea”, and “Lead” will add to the selected item instead of searching for a new match each time.
2AfterSelectionSetting this value to DocumentViewerFindText.Start indicates that the search should begin at the first character after the last text selection in the document. This position may be one character before or after DocumentViewerText.SelectedTextBegin or DocumentViewerText.SelectedTextEnd, depending on the direction of the search. If the search is forward / down the page, the starting point will be the character after DocumentViewerText.SelectedTextEnd; if the search is backward / up the page, the starting point will be the character before DocumentViewerText.SelectedTextBegin.

If no text is selected, DocumentViewerFindText.Start works like FindTextStart.BeginPosition (the default).

If the text selection is within the bounds created by DocumentViewerFindText.BeginPosition and DocumentViewerFindText.EndPosition, this may result in two searches.

The first search will occur from the starting point mentioned above to the position indicated by DocumentViewerFindText.EndPosition. If the starting position is before the beginPosition in the direction of the search, this means only one search is conducted, from the beginPosition to the endPosition. If the starting position is after the endPosition in the direction of the search, no results will be returned.

If DocumentViewerFindText.Loop or DocumentViewerFindText.FindAll is set to true, then a second search may be conducted from the beginPosition to the character before the starting point, provided that the starting point was within the bounds of the search as described above.

This behavior is similar to that in DocumentViewerFindTextStart.InSelection, but with the first character after the text selection instead of the character inside the selection. Effectively, DocumentViewerFindTextStart.InSelection will search the selection first, and DocumentViewerFindTextStart.AfterSelection will not.

When using DocumentViewerFindText.SelectFirstResult, searching from the first character after the selection is useful for “Find Next” and “Find Previous” operations that cycle through all the matches in the bounds.
3ManualPositionIndicates that the search should start from DocumentViewerFindText.ManualStartPosition.

If this value is provided to DocumentViewerFindText.Start, the search operation will use the value of DocumentViewerFindText.ManualStartPosition as the starting point. If DocumentViewerFindText.ManualStartPosition is null, the search will act as if DocumentViewerFindText.BeginPosition was passed to DocumentViewerFindText.Start instead.

See DocumentViewerFindText.ManualStartPosition for more information.

Remarks

DocumentViewerFindTextStart is an enum type that chooses where the DocumentViewerText.Find method will start its search within the provided begin and end parameters. While the DocumentViewerFindText.BeginPosition and DocumentViewerFindText.EndPosition properties specify the bounds of the search, it is the DocumentViewerFindText.Start that determines where the algorithm will begin searching.

If DocumentViewerFindText.Loop or DocumentViewerFindText.FindAll is true, then the text search operation will be cut into two parts – one search from the starting point to the endPosition, and another from the beginPosition to the character before the starting point.

History

19.0.0.49
Added

Example

For an example, see DocumentViewerText.Find.

Requirements

Target Platforms

Help Version 20.0.2019.10.14
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2019 LEAD Technologies, Inc. All Rights Reserved.

Leadtools.Document.Viewer Assembly