Foxit PDF SDK
FoxitPDFSDKPython3.OCREngine Class Reference

Inherits FoxitPDFSDKPython3._object.

Static Public Attributes

 Initialize = _fsdk.OCREngine_Initialize
 Initialize OCR engine. More...
 
 Release = _fsdk.OCREngine_Release
 Release OCR engine. More...
 
 SetLanguages = _fsdk.OCREngine_SetLanguages
 Set the name of languages which would be included in the language database for doing OCR. More...
 
 SetLogFile = _fsdk.OCREngine_SetLogFile
 Set log file for OCR engine. More...
 

Detailed Description

OCR add-on module can be used to convert text content of image to searchable text or editable text in a PDF page or a PDF document. Before using OCR module, user should first prepare OCR resource folder as described in "Foxit PDF SDK Developer Guide.pdf" document. Before initializing OCR engine and using any classes or methods in this module, please ensure Foxti PDF SDK has been initialized successfully by function FoxitPDFSDKPython3.Library.Initialize with a key including "OCR" module.
Currently, OCR module only supports Windows and Linux64 system.

See also
FoxitPDFSDKPython3.Library

Member Data Documentation

◆ Initialize

FoxitPDFSDKPython3.OCREngine.Initialize = _fsdk.OCREngine_Initialize
static

Initialize OCR engine.

This should be called successfully before any other methods in OCR add-on module.

Parameters
[in]ocr_resource_pathFile path of ocr resource folder. It should not be an empty string. Please refer to "Foxit PDF SDK Developer Guide.pdf" document for more details.
Note
If module "OCR" is not defined in the license information which is used in function FoxitPDFSDKPython3.Library.Initialize , that means user has no right in using OCR related functions and this constructor will throw exception FoxitPDFSDKPython3.e_ErrNoOCRModuleRight .
Returns
FoxitPDFSDKPython3.e_ErrSuccess means success.
FoxitPDFSDKPython3.e_ErrNoOCRModuleRight means Foxit PDF SDK has not been initialized with a key including "OCR" module.
FoxitPDFSDKPython3.e_ErrParam means parameter ocrt_resource_path is an empty string.
For more information about error code values, please refer to values starting from FoxitPDFSDKPython3.e_ErrSuccess .

◆ Release

FoxitPDFSDKPython3.OCREngine.Release = _fsdk.OCREngine_Release
static

Release OCR engine.

This function can be called to release OCR engine when no need to use it any more before Foxit PDF SDK is released.

Returns
None.

◆ SetLanguages

FoxitPDFSDKPython3.OCREngine.SetLanguages = _fsdk.OCREngine_SetLanguages
static

Set the name of languages which would be included in the language database for doing OCR.

Current supported languages:

  • When CJK language resources are used, support Chinese-Simplified, Chinese-Traditional, Japanese, Korean.

  • When other language resources are used, support Basque, Bulgarian, Catalan, Croatian, Czech, Danish, Dutch, English , Estonian, Faeroese, Finnish, French, Galician, German, Greek, Hebrew, Hungarian, Icelandic, Italian, Latvian(Lettish), Lithuanian, Macedonian, Maltese, Norwegian, Polish, Portuguese, Romanian, Russian, Serbian, Slovak, Slovenian, Spanish, Swedish, Thai, Turkish, Ukrainian.

If no any language is set by this function, Foxit PDF SDK will use "English" by default.

Parameters
[in]languagesLanguage names. This should not be an empty string. This can contain one language name or several language names separated with commas. For example, "English" means English only, and "English,French" means English and French only.
Returns
None.

◆ SetLogFile

FoxitPDFSDKPython3.OCREngine.SetLogFile = _fsdk.OCREngine_SetLogFile
static

Set log file for OCR engine.

This function is to set the log file for OCR engine, not for Foxit PDF SDK. If user wants to set log file for Foxit PDF SDK, please refer to function FoxitPDFSDKPython3.Library.SetLogFile .

Parameters
[in]log_file_pathA log file path. If this is an empty string, that means stop the log for OCR engine.
Returns
None.