We are running the following code to ocr treat multiple pages.
This shows a progressbar dialog with a cancel button.
When this cancel button is clicked, is there a way to detect how many
pages was proccessed or even detect that cancel was clicked?
Code: Select all
try
{
int nID = _Inst.Str2ID("op.document.OCRPages", false);
IOperation Op = _Inst.CreateOp(nID);
ICabNode input = Op.Params.Root["Input"];
input.v = _Doc;
ICabNode options = Op.Params.Root["Options"];
options["PagesRange.Type"].v = "Exactly";
options["PagesRange.Text"].v = targetpages;
options["ExtParams.Language"].v = "nor";
options["ExtParams.Accuracy"].v = 300;
options["ExtParams.AutoDeskew"].v = false;
options["OutputType"].v = 0;
options["OutputDPI"].v = 300;
_Inst.AsyncDoAndWaitForFinish(Op);
}
catch (Exception ex)
{
}