←Select platform

LoadFields(string) Method

Summary

Loads field data from the specified file.

Syntax

C#
VB
C++
Java
public void LoadFields( 
   string fileName 
) 
  
Public Overloads Sub LoadFields( _ 
   ByVal fileName As String _ 
)  
public void loadFields( 
   java.lang.String string 
) throws java.lang.Exception; 
public: 
void LoadFields(  
   String^ fileName 
)  

Parameters

fileName
The path of the file to load.

Example

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

This example loads form fields from a file.

C#
VB
using Leadtools; 
using Leadtools.Barcode; 
using Leadtools.Codecs; 
using Leadtools.Forms.Common; 
using Leadtools.Ocr; 
using Leadtools.Forms.Processing; 
using Leadtools.Forms.Recognition; 
using Leadtools.Forms.Recognition.Barcode; 
using Leadtools.Forms.Recognition.Ocr; 
 
/// This method loads the specified master form attributes, fields, and image. 
private MasterForm LoadMasterForm(FormRecognitionEngine recognitionEngine, FormProcessingEngine processingEngine, RasterCodecs formsCodec, string attributesFileName, string fieldsFileName, string imageFileName) 
{ 
   byte[] formData; 
   MasterForm form = new MasterForm(); 
   formData = File.ReadAllBytes(attributesFileName); 
   form.Attributes = new FormRecognitionAttributes(); 
   form.Attributes.SetData(formData); 
   form.Properties = recognitionEngine.GetFormProperties(form.Attributes); 
   processingEngine.LoadFields(fieldsFileName); 
   form.ProcessingPages = new FormPages(); 
   form.ProcessingPages.AddRange(processingEngine.Pages); 
   form.Image = formsCodec.Load(imageFileName, 1, CodecsLoadByteOrder.Bgr, 1, -1); 
   return form; 
} 
Imports Leadtools 
Imports Leadtools.Barcode 
Imports Leadtools.Codecs 
Imports Leadtools.Forms.Common 
Imports Leadtools.Ocr 
Imports Leadtools.Forms.Processing 
Imports Leadtools.Forms.Recognition 
Imports Leadtools.Forms.Recognition.Barcode 
Imports Leadtools.Forms.Recognition.Ocr 
 
''' This method loads the specified master form attributes object, fields, and image. 
Private Function LoadMasterForm(ByVal recognitionEngine As FormRecognitionEngine, ByVal processingEngine As FormProcessingEngine, ByVal formsCodec As RasterCodecs, ByVal attributesFileName As String, ByVal fieldsFileName As String, 
      ByVal imageFileName As String) As MasterForm 
   Dim formData As Byte() 
   Dim form As MasterForm = New MasterForm() 
   Dim attributes As FormRecognitionAttributes = recognitionEngine.CreateForm(Nothing) 
   recognitionEngine.CloseForm(attributes) 
   form.Attributes = attributes 
   formData = File.ReadAllBytes(attributesFileName) 
   form.Attributes.SetData(formData) 
   form.Properties = recognitionEngine.GetFormProperties(form.Attributes) 
   processingEngine.LoadFields(fieldsFileName) 
   form.ProcessingPages = New FormPages() 
   form.ProcessingPages.AddRange(processingEngine.Pages) 
   form.Image = formsCodec.Load(imageFileName, 1, CodecsLoadByteOrder.Bgr, 1, -1) 
   Return form 
End Function 

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.Processing Assembly