←Select platform

CreateOmrDateField Method

Summary

Creates a new OmrDateField with automatically filled out field values.

Syntax
C#
VB
C++
public OmrDateField CreateOmrDateField( 
   RasterImage image, 
   List<FormField> formFields, 
   LeadRect bounds, 
   int formPageNumber 
) 
Public Function CreateOmrDateField( 
   ByVal image As RasterImage, 
   ByVal formFields As List(Of FormField 
), 
   ByVal bounds As LeadRect, 
   ByVal formPageNumber As Integer) As OmrDateField 
public:  
   OmrDateField^ CreateOmrDateField( 
      RasterImage^ image, 
      List<FormField^>^ formFields, 
      LeadRect^ bounds, 
      Int32 formPageNumber 
   ) 

Parameters

image

The master form image.

formFields

A FormField list that contains all fields, including the OmrFormField fields within the bounds.

bounds

A Leadtools.LeadRect represents the location of the OmrDateField to be created.

formPageNumber

Master form page number.

Return Value

A OmrDateField field with automatically filled out field values.

Remarks

While automatically creating the field, this method assumes One column for Month and two columns for Day while the Year can have two or four columns.

Example
C#
VB
using Leadtools; 
using Leadtools.Ocr; 
using Leadtools.Forms.Common; 
using Leadtools.Forms.Processing; 
using Leadtools.Forms.Auto; 
using Leadtools.Codecs; 
 
///This example shows how to create a OmrDateField. 
public void AddOmrDateField() 
{ 
   DiskMasterForm diskMasterForm = GetMasterForm("LeadAnswerSheet_Pattern"); 
   LeadRect bounds = new LeadRect(3160, 1345, 745, 1545); 
   FormPages formPages = diskMasterForm.ReadFields(); 
   List<FormField> omrFields = GetOmrFields(formPages); 
 
   // Automatically create OmrDateField 
   OmrDateField omrDateField = diskMasterForm.CreateOmrDateField(diskMasterForm.ReadForm(), omrFields, bounds, 1); 
 
   // Set field name 
   omrDateField.Name = "DateOfBirth"; 
 
   formPages.GetPage(1).Add(omrDateField); 
 
   // Write fields to master form 
   diskMasterForm.WriteFields(formPages); 
} 
Imports Leadtools 
Imports Leadtools.Ocr 
Imports Leadtools.Forms.Common 
Imports Leadtools.Forms.Processing 
Imports Leadtools.Forms.Auto 
Imports Leadtools.Codecs 
 
''' This example shows how to create a OmrDateField. 
Public Sub AddOmrDateField() 
   Dim diskMasterForm As DiskMasterForm = GetMasterForm("LeadAnswerSheet_Pattern") 
   Dim bounds As LeadRect = New LeadRect(3160, 1345, 745, 1545) 
   Dim formPages As FormPages = diskMasterForm.ReadFields() 
   Dim omrFields As List(Of FormField) = GetOmrFields(formPages) 
 
   ' Automatically create OmrDateField 
   Dim omrDateField As OmrDateField = diskMasterForm.CreateOmrDateField(diskMasterForm.ReadForm(), omrFields, bounds, 1) 
 
   ' Set field name 
   omrDateField.Name = "DateOfBirth" 
 
   formPages.GetPage(1).Add(omrDateField) 
 
   ' Write fields to master form 
   diskMasterForm.WriteFields(formPages) 
End Sub 

Requirements

Target Platforms

Help Version 20.0.2020.3.31
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2020 LEAD Technologies, Inc. All Rights Reserved.

Leadtools.Forms.Auto Assembly