public DocumentDifference CompareDocumentPage(
IList<DocumentPageText> pages,
int pageNumber
)
Public Function CompareDocumentPage(
ByVal pages As IList(Of DocumentPageText
),
ByVal pageNumber As Integer) As DocumentDifference
public:
DocumentDifference^ CompareDocumentPage(
IList<DocumentPageText^>^ pages,
Int32 pageNumber
)
pages
List of DocumentPageText objects to compare.
pageNumber
The page number that the DocumentPageText object corresponds to.
A DocumentDifference object.
Exactly two DocumentPageText objects must be provided.
This method compares the DocumentPageText objects and builds positional information about the differences. If you are just interested in comparing the text, use the CompareText(IList<DocumentPageText>) method instead.
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("--------");
}
}
Help Collections
Raster .NET | C API | C++ Class Library | HTML5 JavaScript
Document .NET | C API | C++ Class Library | HTML5 JavaScript
Medical .NET | C API | C++ Class Library | HTML5 JavaScript
Medical Web Viewer .NET
Multimedia
Direct Show .NET | C API | Filters
Media Foundation .NET | C API | Transforms
Supported Platforms
.NET, Java, Android, and iOS/macOS Assemblies
Imaging, Medical, and Document
C API/C++ Class Libraries
Imaging, Medical, and Document
HTML5 JavaScript Libraries
Imaging, Medical, and Document
Your email has been sent to support! Someone should be in touch! If your matter is urgent please come back into chat.
Chat Hours:
Monday - Friday, 8:30am to 6pm ET
Thank you for your feedback!
Please fill out the form again to start a new chat.
All agents are currently offline.
Chat Hours:
Monday - Friday
8:30AM - 6PM EST
To contact us please fill out this form and we will contact you via email.