isInOrder Method

Summary

A helper function for loosely determining whether two DocumentViewerTextPosition objects are in order.

Syntax
TypeScript
JavaScript
isInOrder = function( 
   minPosition, 
   maxPosition 
) 

Parameters

minPosition

The DocumentViewerTextPosition that should be a lower page number and/or character index than maxPosition.

maxPosition

The DocumentViewerTextPosition that should be a higher page number and/or character index than minPosition.

Return Value

true if the minPosition has an explicitly lower page number and/or character index than maxPosition; otherwise, false.

Remarks

IsInOrder indicates whether the two provided DocumentViewerTextPosition are in order from "lowest" to "highest" by PageNumber and then by CharacterIndex. If both page numbers are the same and if maxPosition has a CharacterIndex of -1 (indicating the end of a page), IsInOrder will return true; IsInOrder does not check against the actual last character in any document.

Pseudo-code:

if (minPosition.PageNumber < maxPosition.PageNumber) 
   return true; 
else if (minPosition.PageNumber == maxPosition.PageNumber) 
   return (maxPosition.CharacterIndex == -1) || (minPosition.CharacterIndex != -1 && minPosition.CharacterIndex < maxPosition.CharacterIndex); 
return false; 

History

19.0.0.49
Added
Requirements

Target Platforms

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

Leadtools.Document.Viewer Assembly
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.