Optional delegate method that reports the progress of a specific operation and offers the client an opportunity to cancel.
public delegate bool FormProgressCallback(
int currentPage,
int totalPages,
int percentage
)
Public Delegate Function FormProgressCallback( _
ByVal currentPage As Integer, _
ByVal totalPages As Integer, _
ByVal percentage As Integer _
) As Boolean
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;
using Leadtools.Forms.Recognition;
using Leadtools.Forms.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;
}
Imports Leadtools.Forms
Imports Leadtools.Forms.Recognition
Public Function ProgressCallbackExample(ByVal recognitionEngine As FormRecognitionEngine, ByVal master As FormRecognitionAttributes,
ByVal form As FormRecognitionAttributes) As FormRecognitionResult
Return recognitionEngine.CompareForm(master, form, AddressOf MyFormProgressCallback, AddressOf MyPageProgressCallback)
End Function
Private Sub MyPageProgressCallback(ByVal data As PageProgressCallbackData)
If data.Percentage = 0 Then
Console.WriteLine("--------------------------")
End If
Console.WriteLine("Page progress:{0}%", data.Percentage.ToString("000"))
End Sub
Private Function MyFormProgressCallback(ByVal currentPage As Integer, ByVal totalPages As Integer, ByVal percentage As Integer) As Boolean
If percentage = 0 Then
Console.WriteLine("--------------------------")
End If
Console.WriteLine("Page:{0}/{1} {2}%", currentPage.ToString("00"), totalPages.ToString("00"), percentage.ToString("000"))
Return False
End Function
Raster .NET | C API | C++ Class Library | JavaScript HTML5
Document .NET | C API | C++ Class Library | JavaScript HTML5
Medical .NET | C API | C++ Class Library | JavaScript HTML5
Medical Web Viewer .NET
Your email has been sent to support! Someone should be in touch! If your matter is urgent please come back into chat.
Chat Hours:
Monday - Friday, 8:30am to 6pm ET
Thank you for your feedback!
Please fill out the form again to start a new chat.
All agents are currently offline.
Chat Hours:
Monday - Friday
8:30AM - 6PM EST
To contact us please fill out this form and we will contact you via email.