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.
public void AddFormPage(
int formPageNumber,
FormRecognitionAttributes attributes,
LEADDocument page,
PageRecognitionOptions pageOptions,
PageProgressCallback callback
)
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.
The object should be a Form attributes object. This method does not work with Master Form attributes objects.
This example adds a page to the Form attributes object.
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";
}