TwainAddGdPictureImageToPdfOCR Method

See Also     Examples     Applies To

Appends a GdPicture Image into the multipage PDF file created by the TwainPdfOCRStartEx() function.
This function uses the tesseract engine included into the gdocrplug.tesseract.dll library.
For each language of recognition, you have to deploy specific files. See below.

Syntax

object.TwainAddGdPictureImageToPdfOCR (nImageID, nDictionary, sDictionaryPath, sCharWhiteList)

The TwainAddGdPictureImageToPdfOCR syntax has these parts:

Part Description
object Required. An object expression that evaluates to an object in the Applies To list.
nImageID Required. Long. The GdPicture Image to add to the multipage PDF.
nDictionary Required. Long. The dictionary to use.
Can be:
0: German. Need deu.DangAmbigs, deu.freq-dawg, deu.inttemp, deu.normproto, deu.pffmtable, deu.unicharset, deu.user-words and deu.word-dawg files.
1: Fraktur. Need deu-f.DangAmbigs, deu-f.freq-dawg, deu-f.inttemp, deu-f.normproto, deu-f.pffmtable, deu-f.unicharset, deu-f.user-words and deu-f.word-dawg files.
2: English. Need eng.DangAmbigs, eng.freq-dawg, eng.inttemp, eng.normproto, eng.pffmtable, eng.unicharset, eng.user-words and eng.word-dawg files.
3: French. Need fra.DangAmbigs, fra.freq-dawg, fra.inttemp, fra.normproto, fra.pffmtable, fra.unicharset, fra.user-words and fra.word-dawg files.
4: Italian. Need ita.DangAmbigs, ita.freq-dawg, ita.inttemp, ita.normproto, ita.pffmtable, ita.unicharset, ita.user-words and ita.word-dawg files.
5: Dutch. Need nld.DangAmbigs, nld.freq-dawg, nld.inttemp, nld.normproto, nld.pffmtable, nld.unicharset, nld.user-words and nld.word-dawg files.
6: Portuguese. Need por.DangAmbigs, por.freq-dawg, por.inttemp, por.normproto, por.pffmtable, por.unicharset, por.user-words and por.word-dawg files.
7: Spanish. Need spa.DangAmbigs, spa.freq-dawg, spa.inttemp, spa.normproto, spa.pffmtable, spa.unicharset, spa.user-words and spa.word-dawg files.
8: Vietnamese. Need vie.DangAmbigs, vie.freq-dawg, vie.inttemp, vie.normproto, vie.pffmtable, vie.unicharset, vie.user-words and vie.word-dawg files.
9: Polish. Need pol.DangAmbigs, pol.freq-dawg, pol.inttemp, pol.normproto, pol.pffmtable, pol.unicharset, pol.user-words and pol.word-dawg files.
sDictionaryPath Required. String. The path into which the engine can find the files specified above.
sCharWhiteList Optional. String. Empty by default. This parameter can be used to specify your own white list of chars. IE:
- If you want to recognize only numeric you can use "0123456789".
- If you want to recognize only uppercase alpha you can use "ABCDEFGHIJKLMNOPQRSTUVWXYZ"....

Returns

String. The recognized text.

Remarks

Use the GetStat() function to determine if this function succeded.

Category

TWAIN Functions

Visual Basic Sample

How to scan pages of a document feeder to a multipage searchable PDF file.


Object.TwainOpenDefaultSource
Object.TwainSetAutoFeed (True)
Object.TwainSetAutoScan (True)
If Object.TwainPdfOCRStartEx("MyPdf.pdf") = 0 Then
   While Object.TwainAcquireToGdPictureImage(hwnd) <> 0
         Call Object.TwainAddGdPictureImageToPdfOCR(Object.GetNativeImage, TesseractDictionaryEnglish, App.Path & "\Dict")
         Object.CloseNativeImage
   Wend
   Object.TwainPdfOCRStop
End If
Object.TwainCloseSource






© Copyright 2008 GdPicture All rights reserved.
Documentation MAP.