Foxit PDF SDK
foxit.addon.ocr.OCRConfig Class Reference

Inherits SystemIDisposable.

Public Member Functions

 OCRConfig ()
 Constructor.
 
 OCRConfig (bool is_detect_pictures, bool is_remove_noise, bool is_correct_skew, bool is_enable_text_extraction_mode)
 Constructor, with parameters. More...
 
void Set (bool is_detect_pictures, bool is_remove_noise, bool is_correct_skew, bool is_enable_text_extraction_mode)
 Set value. More...
 

Properties

bool is_correct_skew [get, set]
 Decide whether to enable skew correction. true means to enable skew correction. false means not to enable skew correction. Default value: true. More...
 
bool is_detect_pictures [get, set]
 Decide whether to detect pictures. true means the pictures will be detected during analysis process. false means not to detect the picture, the picture content on the image of PDF document might be interpreted as text. If you would like to extract only text from the image, this option can be set to false. Default value: true.
 
bool is_enable_text_extraction_mode [get, set]
 Decide whether to enable text extraction mode. More...
 
bool is_remove_noise [get, set]
 Decide whether to remove noise of the image of PDF. It can be useful if the image of the PDF contains some noise, such as random black dots or speckles. If the lines of letters on the image are thin, this option should be set to false, otherwise it will affect the recognition of the text. true means the noise in the image will not be recognized during the OCR process. Noise will not be recognized as text. false means not block noise. Default value: true.
 

Detailed Description

This class represents config used for OCR.

Constructor & Destructor Documentation

◆ OCRConfig()

foxit.addon.ocr.OCRConfig.OCRConfig ( bool  is_detect_pictures,
bool  is_remove_noise,
bool  is_correct_skew,
bool  is_enable_text_extraction_mode 
)
inline

Constructor, with parameters.

Parameters
[in]is_detect_picturesDecide whether to detect pictures.
[in]is_remove_noiseDecide whether to remove noise of the image of PDF.
[in]is_correct_skewDecide whether to enable skew correction.
[in]is_enable_text_extraction_modeDecide whether to enable text extraction mode.

Member Function Documentation

◆ Set()

void foxit.addon.ocr.OCRConfig.Set ( bool  is_detect_pictures,
bool  is_remove_noise,
bool  is_correct_skew,
bool  is_enable_text_extraction_mode 
)
inline

Set value.

Parameters
[in]is_detect_picturesDecide whether to detect pictures.
[in]is_remove_noiseDecide whether to remove noise of the image of PDF.
[in]is_correct_skewDecide whether to enable skew correction.
[in]is_enable_text_extraction_modeDecide whether to enable text extraction mode.
Returns
None.

Property Documentation

◆ is_correct_skew

bool foxit.addon.ocr.OCRConfig.is_correct_skew
getset

Decide whether to enable skew correction. true means to enable skew correction. false means not to enable skew correction. Default value: true.

Note
Skew can be corrected only for angles not greater than 20 degrees.

◆ is_enable_text_extraction_mode

bool foxit.addon.ocr.OCRConfig.is_enable_text_extraction_mode
getset

Decide whether to enable text extraction mode.

Usually, when some parts of the text are not be found as a text block such as text on a picture or handwriting, it is recommended to set this parameter to true. It is recommended to set this parameter to false in case the complete text of a picture is recognized correctly or the sample contains images or patterns that may be considered and recognized as text. To be short this parameter enables the Engine to recognize everything remotely close to letters as text. true means to enable text extraction mode, while false means not to enable text extraction mode. Default value: false.