Convert a batch of documents - Code Sample (Linux)

FineReader Engine
11, 12
Code Samples Collection
Recognition, OCR: Speed & Quality
C++, Java
image: icon_batchprocessing.gif

You intend to process a large amount of one-page or several-page documents and want to use the resources of your computer effectively.

This sample in FineReader Engine Linux shows how to use Batch Processor for processing a large amount of one-page documents.


The sample processes a batch of images from the specified folder and saves them in PDF format. The following procedure of multiprocessing recognition is used:

  1. Create the Engine object using the GetEngineObject function (verion 11) or InitializeEngine function (version 12).
  2. Implement the IImageSource and IFileAdapter interfaces, which provide access to the image source and files in it.
  3. Call the CreateBatchProcessor method of the Engine object to receive the BatchProcessor object.
  4. Call the Start method to initialize the processor, invoke asynchronous recognition processes, specify the source of images and processing settings.
  5. Call the GetNextProcessedPage method in a loop until the method returns 0, which means that there are no more images in the source and all the processed images have been returned to the user.
  6. The page returned by the GetNextProcessedPage method exists until the next call of this method. Therefore, if you want to save this page, you must save it before the next call of the GetNextProcessedPage method:
    1. Call the Synthesize method of the FRPage object.
    2. Call the Export method of the FRPage object to save the page into a file of the specified format.
  7. Unload FineReader Engine — use the DeinitializeEngine function.

Back To:

This website uses cookies which enable you to see pages or use other functions of our websites. You can turn off such cookies in your browser’s settings. If you continue to use these pages, you consent to the use of cookies.