←Select platform

AddFormPage(int,FormRecognitionAttributes,LEADDocument,PageRecognitionOptions,PageProgressCallback) Method

Summary

Appends the page at a given index from the LEADDocument to the FormRecognitionAttributes object. The Form attributes object should be opened before the addition using OpenForm.

Syntax
C#
C++/CLI
Python

Parameters

formPageNumber

Page number of the LEADDocument to be inserted in the Form attributes object.

attributes

The Form attributes object.

page

The LEADDocument.

pageOptions

Specifies the options for the page.

callback

Optional callback to show operation progress.

Remarks

The object should be a Form attributes object. This method does not work with Master Form attributes objects.

Example

This example adds a page to the Form attributes object.

C#
using Leadtools; 
using Leadtools.Barcode; 
using Leadtools.Codecs; 
using Leadtools.Document; 
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; 
 
public void AddPageToFormAttributes() 
{ 
   // Create a form attributes object using recognition engine 
   FormRecognitionEngine recognitionEngine = new FormRecognitionEngine(); 
   FormRecognitionAttributes attributes = recognitionEngine.CreateForm(null); 
 
   // Load LEADDocument from file 
   LEADDocument leadDoc = DocumentFactory.LoadFromFile(Path.Combine(LEAD_VARS.ImagesDir, @"Forms\Filled Forms\FCC-107_OCR_Filled.tif"), null); 
 
   // Specify the page recognition options 
   PageRecognitionOptions pageOptions = new PageRecognitionOptions 
   { 
      PageType = FormsPageType.Normal 
   }; 
 
   recognitionEngine.OpenForm(attributes); 
   // Add first page from LEADDocument to Form attributes object 
   recognitionEngine.AddFormPage(0, attributes, leadDoc, pageOptions, null); 
   recognitionEngine.CloseForm(attributes); 
 
   leadDoc.Dispose(); 
} 
 
static class LEAD_VARS 
{ 
   public const string ImagesDir = @"C:\LEADTOOLS23\Resources\Images"; 
} 
Requirements

Target Platforms

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

Leadtools.Forms.Recognition Assembly
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.