public delegate bool FormProgressCallback(
int currentPage,
int totalPages,
int percentage
)
currentPage
The 1-based index of the current page.
totalPages
The total number of pages.
percentage
A value between 0 and 100 that represents the percent completion of the process.
true to continue the process, false to cancel the process.
This example compares a Master Form attribute with a Form attributes.
using Leadtools.Forms.Common;
using Leadtools.Forms.Recognition;
using Leadtools.Ocr;
using Leadtools.Forms.Processing;
using Leadtools.Forms.Recognition.Barcode;
using Leadtools.Forms.Recognition.Ocr;
// Text writer to save the log to
public FormRecognitionResult ProgressCallbackExample(FormRecognitionEngine recognitionEngine,
FormRecognitionAttributes master,
FormRecognitionAttributes form)
{
return recognitionEngine.CompareForm(master, form, MyFormProgressCallback, MyPageProgressCallback);
}
private void MyPageProgressCallback(PageProgressCallbackData data)
{
if (data.Percentage == 0)
Console.WriteLine("--------------------------");
Console.WriteLine("Page progress:{0}%", data.Percentage.ToString("000"));
}
private bool MyFormProgressCallback(int currentPage, int totalPages, int percentage)
{
if (percentage == 0)
Console.WriteLine("--------------------------");
Console.WriteLine("Page:{0}/{1} {2}%",
currentPage.ToString("00"),
totalPages.ToString("00"),
percentage.ToString("000"));
return false;
}