CompareDocumentPage Method
Example
using Leadtools.Document;
using Leadtools.Document.Compare;
using Leadtools;
public void CompareDocumentPageExample()
{
var doc1 = DocumentFactory.LoadFromFile(pathToDocument1, new LoadDocumentOptions());
var doc2 = DocumentFactory.LoadFromFile(pathToDocument2, new LoadDocumentOptions());
var textList = new List<DocumentPageText>()
{
doc1.Pages.First().GetText(),
doc2.Pages.First().GetText()
};
var comparer = new DocumentComparer();
var diffs = comparer.CompareDocumentPage(textList, 1);
foreach (PageCharactersDifference diff in diffs.Differences)
{
Console.WriteLine($"Operations: {diff.Operation}");
Console.WriteLine($"Text: {diff.Text}");
foreach(PageCharacter pageChar in diff.Characters)
{
Console.WriteLine($" Character: {pageChar.Character}");
Console.WriteLine($" Character Index: {pageChar.CharacterIndex}");
Console.WriteLine($" Page Number: {pageChar.PageNumber}");
Console.WriteLine($" Wordmap Index: {pageChar.WordMapIndex}");
}
Console.WriteLine("--------");
}
}