Products | Support | Email a link to this topic. | Send comments on this topic. | Back to Introduction - All Topics | Help Version 19.0.5.10
|
Leadtools.Forms.Recognition Namespace > FormRecognitionEngine Class > GetFormAlignment Method : GetFormAlignment(FormRecognitionAttributes,FormRecognitionAttributes,FormProgressCallback,PageProgressCallback) Method |
public IList<PageAlignment> GetFormAlignment( FormRecognitionAttributes masterAttributes, FormRecognitionAttributes formAttributes, FormProgressCallback formCallback, PageProgressCallback pageCallback )
'Declaration Public Overloads Function GetFormAlignment( _ ByVal masterAttributes As FormRecognitionAttributes, _ ByVal formAttributes As FormRecognitionAttributes, _ ByVal formCallback As FormProgressCallback, _ ByVal pageCallback As PageProgressCallback _ ) As IList(Of PageAlignment)
'Usage Dim instance As FormRecognitionEngine Dim masterAttributes As FormRecognitionAttributes Dim formAttributes As FormRecognitionAttributes Dim formCallback As FormProgressCallback Dim pageCallback As PageProgressCallback Dim value As IList(Of PageAlignment) value = instance.GetFormAlignment(masterAttributes, formAttributes, formCallback, pageCallback)
For a complete example on using the forms recognition and processing, refer to the FormRecognitionEngine example.
This example adds a page to the form
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 aligmnet for the recognized form. Private Sub AlignForm(recognitionEngine As FormRecognitionEngine, form As MyForm, calculateAlignment As Boolean) If calculateAlignment Then form.Alignment = recognitionEngine.GetFormAlignment(form.Master.Attributes, form.Attributes, Nothing) Else form.Alignment = New List(Of PageAlignment)() For i As Integer = 0 To form.Result.PageResults.Count - 1 form.Alignment.Add(form.Result.PageResults(i).Alignment) Next 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. private 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); } }