'Declaration
Public Overloads Function OcrPages( _ ByVal PageRange As String, _ ByVal ThreadCount As Integer, _ ByVal Dictionary As String, _ ByVal DictionaryPath As String, _ ByVal CharWhiteList As String, _ ByVal DPI As Single, _ ByVal OcrMode As OCRMode, _ ByVal TimeoutMillisec As Integer, _ ByVal Sync As Boolean _ ) As GdPictureStatus
public GdPictureStatus OcrPages( string PageRange, int ThreadCount, string Dictionary, string DictionaryPath, string CharWhiteList, float DPI, OCRMode OcrMode, int TimeoutMillisec, bool Sync )
public function OcrPages( PageRange: String; ThreadCount: Integer; Dictionary: String; DictionaryPath: String; CharWhiteList: String; DPI: Single; OcrMode: OCRMode; TimeoutMillisec: Integer; Sync: Boolean ): GdPictureStatus;
public function OcrPages( PageRange : String, ThreadCount : int, Dictionary : String, DictionaryPath : String, CharWhiteList : String, DPI : float, OcrMode : OCRMode, TimeoutMillisec : int, Sync : boolean ) : GdPictureStatus;
public: GdPictureStatus OcrPages( string* PageRange, int ThreadCount, string* Dictionary, string* DictionaryPath, string* CharWhiteList, float DPI, OCRMode OcrMode, int TimeoutMillisec, bool Sync )
public: GdPictureStatus OcrPages( String^ PageRange, int ThreadCount, String^ Dictionary, String^ DictionaryPath, String^ CharWhiteList, float DPI, OCRMode OcrMode, int TimeoutMillisec, bool Sync )
Parameters
- PageRange
- The page range to be processed, for example, "1;4;5" to process pages 1, 4 and 5 or "1-5;10" to process pages from 1 to 5 and page 10. Set this parameter to "*" to process all pages of the current document.
- ThreadCount
- The number of threads to use, asynchronously. Set this parameter to 0 to let the engine to automatically maximize the performance.
- Dictionary
- The prefix of the dictionary file to use, for example, "spa" for Spanish, "eng" for English, "fra" for French, etc.
The name of such dictionary file has a predefined format [LANGUAGE].traineddata, where [LANGUAGE] defines the used language. You can find these files within your standard installation usually in the directory @\GdPicture.Net 14\Redist\OCR or you can download additional language dictionary files here.
You can also combine multiple dictionaries with the "+" separator, for instance English with French is "eng+fra".
- DictionaryPath
- The path with all installed dictionary files the OCR engine will use. The proper path is usually within your standard installation and it looks like @\GdPicture.Net 14\Redist\OCR. Of course you can specify your own path as well.
- CharWhiteList
- So called white list of characters, in other words the restricted recognition characters. It means that the engine returns only the specified characters when processing. For example, if you want to only recognize numeric characters, set this parameter to "0123456789". If you want to only recognize uppercase letters, set it to "ABCDEFGHIJKLMNOPQRSTUVWXYZ". Set this parameter to the empty string to recognize all characters.
- DPI
- The dpi resolution the OCR engine will use. It is recommended to use 300 by default.
A value between 200 and 300 should give optimal results on A4-sized documents. Generally values over 300 will cause excessive memory usage.
- OcrMode
- The mode to be used during processing. You can choose between speed and accuracy.
- TimeoutMillisec
- The time interval, in other words timeout, in milliseconds, that specifies the maximum time allowed for the whole OCR process before it is automatically interrupted. Use 0 to specify no timeout.
- Sync
- In multi-threading context, this parameter specifies if the method must terminate when all threads are done.
Return Value
We strongly recommend always checking this status first.