Imports Leadtools
Imports Leadtools.Barcode
Imports Leadtools.Codecs
Imports Leadtools.Forms
Imports Leadtools.Forms.Ocr
Imports Leadtools.Forms.Processing
Imports Leadtools.Forms.Recognition
Imports Leadtools.Forms.Recognition.Barcode
Imports Leadtools.Forms.Recognition.Ocr
'''This method calculates the alignment for the recognized form.
Public Sub AlignForm(ByVal recognitionEngine As FormRecognitionEngine, _
ByVal form As MyForm, _
ByVal calculateAlignment As Boolean)
If calculateAlignment Then
form.Alignment = recognitionEngine.GetFormAlignment(form.Master.Attributes, _
form.Attributes, Nothing)
Else
form.Alignment = New List(Of PageAlignment)()
Dim i As Integer = 0
Do While i < form.Result.PageResults.Count
form.Alignment.Add(form.Result.PageResults(i).Alignment)
i += 1
Loop
End If
End Sub
using Leadtools;
using Leadtools.Barcode;
using Leadtools.Codecs;
using Leadtools.Forms;
using Leadtools.Forms.Ocr;
using Leadtools.Forms.Processing;
using Leadtools.Forms.Recognition;
using Leadtools.Forms.Recognition.Barcode;
using Leadtools.Forms.Recognition.Ocr;
///This method calculates the aligmnet for the recognized form.
public void AlignForm(FormRecognitionEngine recognitionEngine, MyForm form, bool calculateAlignment)
{
if(calculateAlignment)
{
form.Alignment = recognitionEngine.GetFormAlignment(form.Master.Attributes, form.Attributes, null);
}
else
{
form.Alignment = new List<PageAlignment>();
for(int i = 0; i < form.Result.PageResults.Count; i++)
form.Alignment.Add(form.Result.PageResults[i].Alignment);
}
}