OCR: Abbyy FineReader integration

This tip describes how to integrate optical character recognition into your system.

It's really easy to enhance your applications with optical character recognition (OCR) using Abbyy's popular FineReader application. The code below has been tested with FR4 but should work with later versions too (using 'CreateObject("FineReader.Application")').

Just insert a button with the code below in your form design and start to scan RTF text into Notes Body field directly.

PS: If s/o has any information about the help file 'frapi.hlp' please let me know - I'm convinced FineReader could even be more closely integrated. But although I have a regular FR license this file wasn't provided.

Sub Click(Source As Button)
 On Error Goto ErrorHandler 
 Dim ws As New NotesUIWorkspace
 Dim uidoc As NotesUIDocument
 Dim appFR As Variant
 Set uidoc = ws.CurrentDocument
 Set appFR=CreateObject({FineReader.Application.4})
 If appFR Is Nothing Then
  Msgbox {Couldn't find FineReader4 on the local system!}
  Exit Sub
 End If
 appFR.DoCommand (73) 'scan+read single page
 appFR.DoCommand (12) 'copy to clipboard
 Call uidoc.GotoField({Body})
 Call uidoc.Paste 'insert clipboard contents
 Exit Sub
 Messagebox {An unexpected error has occured: } & Trim$(Str(Err)) & {: } & Error$, 0+48+0+0, {Error Message..}
 Resume TheEnd 
End Sub

Dig Deeper on Domino Resources - Part 6

  • Favorite iSeries cheat sheets

    Here you'll find a collection of valuable cheat sheets gathered from across the iSeries/Search400.com community. These cheat ...