Send comments on this topic. | Back to Introduction - All Topics | Help Version 16.5.9.25
Working with OCR Pages

After starting the OCR engine, you can begin working with the document page(s). An OCR document contains one or more pages.

The LEADTOOLS OCR methods provide support for the following when working with OCR pages:

  • Creating one or more OCR documents
  • Adding or removing pages to a OCR document
  • Getting information about one ore more pages
  • Exporting pages
  • Updating pages

An instance of IOcrDocument contains the pages of a document. You can create a new OCR document using the IOcrDocumentManager.CreateDocument method.

Each OCR document can one or more pages (IOcrPage objects). Each IOcrDocument contains an IOcrDocument.Pages property of type IOcrPageCollection that you can use to access the pages of a document.

IOcrDocument through the IOcrDocument.Pages property holds a collection of IOcrPage objects. Each of these IOcrPage objects contains the raster image used to create it (the image used when the page is loaded or added) and a group of OCR zones for the page either added manually or through auto-zoning.

The IOcrPageCollection interface implements standard .NET Generic ICollection, Generic IList, and Generic IEnumerable interfaces and hence, you can use the member of these interfaces to add, remove, get, set and iterate through the different pages of the document.

The following list contains the major functionality of the IOcrPageCollection interface:

  • Add new pages to the document from raster image files. These files can be in disk files, a .NET stream (memory or otherwise) or even in a remote URL. The following table lists all the page addition method groups:
    MethodsDescription
    IOcrPageCollection.AddPageAdds a single page from a RasterImage, DIB or an image file in disk file, .NET stream, remote URL.
    IOcrPageCollection.AddPagesAdds multiple pages from a multi-page RasterImage or an image file in disk file, .NET stream or remote URL.
    IOcrPageCollection.InsertPageInserts into a specific location a single page from a RasterImage, DIB or an image file in disk file, .NET stream, remote URL.
    IOcrPageCollection.InsertPagesInserts into a specific location multiple pages from a multi-page RasterImage or an image file in disk file, .NET stream or remote URL.
  • Export pages from the OCR document to raster image files. You can save the pages in disk files, .NET streams or as a single or multi-page RasterImage object with any of the file formats supported by LEADTOOLS. The following table list all the page exporting method groups:
    MethodsDescription
    IOcrPageCollection.ExportPageSaves a single page in the document to a RasterImage object, an image file in disk file or a .NET stream.
    IOcrPageCollection.ExportPagesSaves multiple pages in the document to a multi-page RasterImage object, an image file in disk file or a .NET stream.
  • Perform auto image preprocessing on a single or multiple pages in the document through IOcrPageCollection.AutoPreprocess. These methods provide a shortcut for iterating through the pages in the collection and calling IOcrPage.AutoPreprocess on each page.
  • Perform auto-zoning on a single or multiple pages in the document through IOcrPageCollection.AutoZone. These methods provide a shortcut for iterating through the pages in the collection and calling IOcrPage.AutoZone on each page.
  • Update the type of text in the zones of on a single or multiple pages in the document through IOcrPageCollection.UpdateFillMethod. These methods provide a shortcut for iterating through the pages in the collection and calling IOcrPage.UpdateFillMethod on each page.
  • Recognize a single or multiple pages in the document through IOcrPageCollection.Recognize. These methods provide a shortcut for iterating through the pages in the collection and calling IOcrPage.Recognize on each page.
  • Perform high level "fire and forget" approach to OCR recognition through IOcrAutoRecognizeManager
  • Recognize single or multiple files and save recognition results to a file with a single function by calling IOcrAutoRecognizeManager.Run method.

See Also