Events Handling - Code Sample (Linux)

FineReader Engine
11, 12
Code Samples Collection
Programming Aspects
C++, Java
image: fre12_icon_eventhandler.gif

The sample demonstrates how to use callback interfaces using the FRDocument callback interface (IFRDocumentEvents) as an example. The sample illustrates how to show information about approximate percentage of the current operation during image processing.


The procedure of reporting events from the FRDocument object to the listeners uses the methods of the IFRDocumentEvents interface. Do the following:

  1. Create the Engine object using the GetEngineObject function (version 11) or the InitializeEngine function (version 12).
  2. [optional] Load a predefined profile for your scenario using the LoadPredefinedProfile method of the Engine object.
  3. Call the CreateFRDocument method of the Engine object to create the FRDocument object.
  4. Add pages from an image file to the document. Use the AddImageFile method of the FRDocument object.
  5. To report percentage of image processing performed, connect an object on the client side to the notification source. Use the OnProgress method of the IFRDocumentEvents interface.
  6. Call the Process method of the FRDocument object.
  7. Call the Export method of the FRDocument object to save the document to a file of the specified format.
  8. Close the FRDocument object using the Close method.
  9. 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.