Error processing SSI file
LEADTOOLS OCR (Leadtools.Forms.Ocr assembly)

Show in webframe

OcrAutoRecognizeManagerJobOperation Enumeration








IOcrAutoRecognizeManager job operations.
Syntax
public enum OcrAutoRecognizeManagerJobOperation : System.Enum, System.IComparable, System.IConvertible, System.IFormattable  
'Declaration
 
Public Enum OcrAutoRecognizeManagerJobOperation 
   Inherits System.Enum
   Implements System.IComparable, System.IConvertible, System.IFormattable 
'Usage
 
Dim instance As OcrAutoRecognizeManagerJobOperation
public enum OcrAutoRecognizeManagerJobOperation : System.IComparable, System.IConvertible, System.IFormattable  
typedef NS_ENUM(NSInteger, LTOcrAutoRecognizeManagerJobOperation)
public enum OcrAutoRecognizeManagerJobOperation
Leadtools.Forms.Ocr.OcrAutoRecognizeManagerJobOperation = function() { };
Leadtools.Forms.Ocr.OcrAutoRecognizeManagerJobOperation.prototype = {<br/>
  Other = 0,
	CreateDocument = 1,
	PrepareDocument = 2,
	LoadPage = 3,
	PreprocessPage = 4,
	ZonePage = 5,
	RecognizePage = 6,
	SavePage = 7,
	AppendLtd = 8,
	SaveDocument = 9,
	ConvertDocument = 10,
	
 };
public enum class OcrAutoRecognizeManagerJobOperation : public System.Enum, System.IComparable, System.IConvertible, System.IFormattable  
Members
ValueMemberDescription
0Other Other operation, such as unexpected and unrecoverable errors.
1CreateDocument The IOcrAutoRecognizeManager is creating a document with IOcrDocumentManager.CreateDocument.
2PrepareDocument Preparing the IOcrDocument, in certain situations, by clearing all the pages inside it.
3LoadPage Loading the image of a page using RasterCodecs.Load. The page is then created using IOcrEngine.CreatePage.
4PreprocessPage Preprocessing a page using IOcrPage.AutoPreprocess.
5ZonePage Zoning a page using IOcrPage.AutoZone or IOcrPage.LoadZone.Note that when using the IOcrAutoRecognizeManager.JobOperation event, you can use this operation to zone the page manually as shown in the OcrAutoRecognizeJobOperationEventArgs example.
6RecognizePage Recognizing a page using IOcrPage.Recognize.
7SavePage Saving a page using IOcrDocument.Save or IOcrDocument.SaveAsync.
8AppendLtd Appending multiple LTD's using DocumentWriter.AppendLtd.
9SaveDocument Saving a document using IOcrDocument.Save or IOcrDocument.SaveAsync.
10ConvertDocument Converting a document to its final format using DocumentWriter.Convert.
Remarks

Used as type for the following properties:

IOcrAutoRecognizeManager allows you to modify the raster image, OCR page or OCR document during some parts of the operation. Refer to OcrAutoRecognizeJobOperationEventArgs.PageImage for more information an example.

The OcrAutoRecognizeJobOperationEventArgs.Status property can be set to OcrAutoRecognizeJobStatus.Abort inside the event handler to abort the current operation. Aborting the operation will cause the whole job to be canceled. The only exception is with LoadPage. If Status is set to Abort, then the page will be skipped and not added to the final document. The following code performs custom processing (in this example, blank page detection) to skip specific pages from being added to the final document:


             // Our IOcrAutoRecognizeManager.JobOperation event handler
             EventHandler<OcrAutoRecognizeJobOperationEventArgs> jobOperation = (object sender, OcrAutoRecognizeJobOperationEventArgs e) =>
             {
                if (e.Operation == OcrAutoRecognizeManagerJobOperation.LoadPage && !e.PostOperation)
                {
                   // IOcrPage has been created with an image loaded, check if it is empty
                   // Get the image
                   using (RasterImage image = e.Page.GetRasterImage(OcrPageType.Original))
                   {
                      // Run the blank bage detector command
                      var blankPageDetector = new BlankPageDetectorCommand(BlankPageDetectorCommandFlags.None, 0, 0, 0, 0);
                      blankPageDetector.Run(image);
                      if (blankPageDetector.IsBlank)
                      {
                         // The image is blank, inform the OCR auto recognize manager to skip it
                         e.Status = OcrAutoRecognizeManagerJobStatus.Abort;
                      }
                   }
                }
             };
            
             IOcrAutoRecognizeManager ocrAutoRecognizeManager = ocrEngine.AutoRecognizeManager;
            
             // Create the job
             var jobData = new OcrAutoRecognizeJobData(inputFile, DocumentFormat.Pdf, outputFile);
             IOcrAutoRecognizeJob ocrJob = ocrAutoRecognizeManager.CreateJob(jobData);
            
             // Add our event
             ocrAutoRecognizeManager.JobOperation += jobOperation;
             // Run the job
             ocrAutoRecognizeManager.RunJob(ocrJob);
             ocrAutoRecognizeManager.JobOperation -= jobOperation;
             
Example
For an example, refer to RunJob and OcrAutoRecognizeJobOperationEventArgs.
Inheritance Hierarchy

System.Object
   System.ValueType
      System.Enum
         Leadtools.Forms.Ocr.OcrAutoRecognizeManagerJobOperation

Requirements

Target Platforms

See Also

Reference

Leadtools.Forms.Ocr Namespace
Programming with the LEADTOOLS .NET OCR

Error processing SSI file
Leadtools.Forms.Ocr requires a Recognition or Document Imaging Suite license and unlock key. For more information, refer to: LEADTOOLS Toolkit Features