Leadtools.Forms.Recognition Requires Document/Medical product license | Send comments on this topic. | Back to Introduction - All Topics | Help Version 16.5.9.25
GetFormAlignment(FormRecognitionAttributes,FormRecognitionAttributes,FormProgressCallback) Method
See Also  Example
Leadtools.Forms.Recognition Namespace > FormRecognitionEngine Class > GetFormAlignment Method : GetFormAlignment(FormRecognitionAttributes,FormRecognitionAttributes,FormProgressCallback) Method



masterAttributes
The Master Form attributes object.
formAttributes
The Form attributes object.
callback
Provides status on the progress of the alignment calculations. Set it to null to ignore the progress.
masterAttributes
The Master Form attributes object.
formAttributes
The Form attributes object.
callback
Provides status on the progress of the alignment calculations. Set it to null to ignore the progress.
Returns a list of PageAlignment objects that determines the amount of shift and scaling for each page of the Form with its corresponding page in the specified Master Form.

Syntax

Visual Basic (Declaration) 
Overloads Public Function GetFormAlignment( _
   ByVal masterAttributes As FormRecognitionAttributes, _
   ByVal formAttributes As FormRecognitionAttributes, _
   ByVal callback As FormProgressCallback _
) As IList(Of PageAlignment)
Visual Basic (Usage)Copy Code
Dim instance As FormRecognitionEngine
Dim masterAttributes As FormRecognitionAttributes
Dim formAttributes As FormRecognitionAttributes
Dim callback As FormProgressCallback
Dim value As IList(Of PageAlignment)
 
value = instance.GetFormAlignment(masterAttributes, formAttributes, callback)

Parameters

masterAttributes
The Master Form attributes object.
formAttributes
The Form attributes object.
callback
Provides status on the progress of the alignment calculations. Set it to null to ignore the progress.

Example

For a complete example on using the forms recognition and processing, refer to the FormRecognitionEngine example.

This example adds a page to the form

Visual BasicCopy Code
'''This method calculates the aligmnet 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
C#Copy Code
///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); 
   } 
}

Remarks

Alignment is necessarliy for Forms processing to extract the data from their ccorrect positions. It returns a PageAlignment that aligns any LogicalRectangle located in the Master Form to its equivelent area position in the Form.

Requirements

Target Platforms: Microsoft .NET Framework 3.0, Windows XP, Windows Server 2003 family, Windows Server 2008 family

See Also

Leadtools.Forms requires a Forms Module license and unlock key. For more information, refer to: Imaging Pro/Document/Medical Features