LEADTOOLS Forms (Leadtools.Forms.Recognition assembly)
LEAD Technologies, Inc

GetFormAlignment(FormRecognitionAttributes,FormRecognitionAttributes,FormProgressCallback) Method

Example 





The Master Form attribute object.
The Form attribute object.
Provides status on the progress of the alignment calculations. Set it to null to ignore the progress.
Returns a list of Leadtools.Forms.PageAlignment objects that determine the amount of shift and scaling for each page of the Form with its corresponding page in the specified Master Form.
Syntax
'Declaration
 
Public Overloads Function GetFormAlignment( _
   ByVal masterAttributes As FormRecognitionAttributes, _
   ByVal formAttributes As FormRecognitionAttributes, _
   ByVal callback As FormProgressCallback _
) As IList(Of PageAlignment)
'Usage
 
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)
 function Leadtools.Forms.Recognition.FormRecognitionEngine.GetFormAlignment(FormRecognitionAttributes,FormRecognitionAttributes,FormProgressCallback)( 
   masterAttributes ,
   formAttributes ,
   callback 
)

Parameters

masterAttributes
The Master Form attribute object.
formAttributes
The Form attribute object.
callback
Provides status on the progress of the alignment calculations. Set it to null to ignore the progress.
Remarks
Alignment is necessary when processing forms so that data can be extracted correctly. This function returns a Leadtools.Forms.PageAlignment object that aligns a Leadtools.Forms.LogicalRectangle located in the Master Form to its equivalent position in the Form.
Example
 
'''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
///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);
   }
}
Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also

Reference

FormRecognitionEngine Class
FormRecognitionEngine Members
Overload List

 

 


Products | Support | Contact Us | Copyright Notices

© 2006-2012 All Rights Reserved. LEAD Technologies, Inc.

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