Pdftools SDK
Loading...
Searching...
No Matches
Macros | Typedefs | Functions
PdfTools_PdfToolsOcr.h File Reference
#include "PdfTools_Types.h"
#include "PdfTools_PdfToolsSys.h"

Go to the source code of this file.

Macros

#define PDFTOOLS_CALL
 
#define PdfToolsOcr_Engine_Create   PdfToolsOcr_Engine_CreateA
 
#define PdfToolsOcr_Engine_GetLanguages   PdfToolsOcr_Engine_GetLanguagesA
 
#define PdfToolsOcr_Engine_SetLanguages   PdfToolsOcr_Engine_SetLanguagesA
 
#define PdfToolsOcr_Engine_GetParameters   PdfToolsOcr_Engine_GetParametersA
 
#define PdfToolsOcr_Engine_SetParameters   PdfToolsOcr_Engine_SetParametersA
 
#define TPdfToolsOcr_Processor_Warning   TPdfToolsOcr_Processor_WarningA
 
#define PdfToolsOcr_Processor_AddWarningHandler   PdfToolsOcr_Processor_AddWarningHandlerA
 
#define PdfToolsOcr_Processor_RemoveWarningHandler   PdfToolsOcr_Processor_RemoveWarningHandlerA
 

Typedefs

typedef void(PDFTOOLS_CALLTPdfToolsOcr_Processor_WarningA) (void *pContext, const char *szMessage, TPdfToolsOcr_WarningCategory iCategory, int iPageNo, const char *szContext)
 Event for warnings occurring during OCR processing Non-critical issues during processing are reported via this event. It is recommended to review the TPdfToolsOcr_WarningCategory and handle warnings if necessary for the application.
 
typedef void(PDFTOOLS_CALLTPdfToolsOcr_Processor_WarningW) (void *pContext, const WCHAR *szMessage, TPdfToolsOcr_WarningCategory iCategory, int iPageNo, const WCHAR *szContext)
 Event for warnings occurring during OCR processing Non-critical issues during processing are reported via this event. It is recommended to review the TPdfToolsOcr_WarningCategory and handle warnings if necessary for the application.
 

Functions

PDFTOOLS_EXPORT TPdfToolsOcr_ImageOptions *PDFTOOLS_CALL PdfToolsOcr_ImageOptions_New (void)
 
PDFTOOLS_EXPORT TPdfToolsOcr_ImageProcessingMode PDFTOOLS_CALL PdfToolsOcr_ImageOptions_GetMode (TPdfToolsOcr_ImageOptions *pImageOptions)
 The mode for processing images Default value: ePdfToolsOcr_ImageProcessingMode_None.
 
PDFTOOLS_EXPORT BOOL PDFTOOLS_CALL PdfToolsOcr_ImageOptions_SetMode (TPdfToolsOcr_ImageOptions *pImageOptions, TPdfToolsOcr_ImageProcessingMode iMode)
 The mode for processing images Default value: ePdfToolsOcr_ImageProcessingMode_None.
 
PDFTOOLS_EXPORT BOOL PDFTOOLS_CALL PdfToolsOcr_ImageOptions_GetRotateScan (TPdfToolsOcr_ImageOptions *pImageOptions)
 Whether to rotate scanned pages based on detected orientation.
 
PDFTOOLS_EXPORT BOOL PDFTOOLS_CALL PdfToolsOcr_ImageOptions_SetRotateScan (TPdfToolsOcr_ImageOptions *pImageOptions, BOOL bRotateScan)
 Whether to rotate scanned pages based on detected orientation.
 
PDFTOOLS_EXPORT BOOL PDFTOOLS_CALL PdfToolsOcr_ImageOptions_GetDeskewScan (TPdfToolsOcr_ImageOptions *pImageOptions)
 Whether to deskew scanned pages.
 
PDFTOOLS_EXPORT BOOL PDFTOOLS_CALL PdfToolsOcr_ImageOptions_SetDeskewScan (TPdfToolsOcr_ImageOptions *pImageOptions, BOOL bDeskewScan)
 Whether to deskew scanned pages.
 
PDFTOOLS_EXPORT BOOL PDFTOOLS_CALL PdfToolsOcr_ImageOptions_GetRemoveOnlyInvisibleOcrText (TPdfToolsOcr_ImageOptions *pImageOptions)
 Whether to remove only invisible OCR text (text rendering mode 3)
 
PDFTOOLS_EXPORT BOOL PDFTOOLS_CALL PdfToolsOcr_ImageOptions_SetRemoveOnlyInvisibleOcrText (TPdfToolsOcr_ImageOptions *pImageOptions, BOOL bRemoveOnlyInvisibleOcrText)
 Whether to remove only invisible OCR text (text rendering mode 3)
 
PDFTOOLS_EXPORT TPdfToolsOcr_TextOptions *PDFTOOLS_CALL PdfToolsOcr_TextOptions_New (void)
 
PDFTOOLS_EXPORT TPdfToolsOcr_TextProcessingMode PDFTOOLS_CALL PdfToolsOcr_TextOptions_GetMode (TPdfToolsOcr_TextOptions *pTextOptions)
 The mode for processing text Default value: ePdfToolsOcr_TextProcessingMode_None.
 
PDFTOOLS_EXPORT BOOL PDFTOOLS_CALL PdfToolsOcr_TextOptions_SetMode (TPdfToolsOcr_TextOptions *pTextOptions, TPdfToolsOcr_TextProcessingMode iMode)
 The mode for processing text Default value: ePdfToolsOcr_TextProcessingMode_None.
 
PDFTOOLS_EXPORT TPdfToolsOcr_TextSkipMode PDFTOOLS_CALL PdfToolsOcr_TextOptions_GetSkipMode (TPdfToolsOcr_TextOptions *pTextOptions)
 Define text that can be skipped from text OCR processing Default value: ePdfToolsOcr_TextSkipMode_None.
 
PDFTOOLS_EXPORT BOOL PDFTOOLS_CALL PdfToolsOcr_TextOptions_SetSkipMode (TPdfToolsOcr_TextOptions *pTextOptions, TPdfToolsOcr_TextSkipMode iSkipMode)
 Define text that can be skipped from text OCR processing Default value: ePdfToolsOcr_TextSkipMode_None.
 
PDFTOOLS_EXPORT TPdfToolsOcr_UnicodeSource PDFTOOLS_CALL PdfToolsOcr_TextOptions_GetUnicodeSource (TPdfToolsOcr_TextOptions *pTextOptions)
 Define additional ToUnicode sources in addition to OCR processing Default value: ePdfToolsOcr_UnicodeSource_None.
 
PDFTOOLS_EXPORT BOOL PDFTOOLS_CALL PdfToolsOcr_TextOptions_SetUnicodeSource (TPdfToolsOcr_TextOptions *pTextOptions, TPdfToolsOcr_UnicodeSource iUnicodeSource)
 Define additional ToUnicode sources in addition to OCR processing Default value: ePdfToolsOcr_UnicodeSource_None.
 
PDFTOOLS_EXPORT TPdfToolsOcr_PageOptions *PDFTOOLS_CALL PdfToolsOcr_PageOptions_New (void)
 
PDFTOOLS_EXPORT TPdfToolsOcr_PageProcessingMode PDFTOOLS_CALL PdfToolsOcr_PageOptions_GetMode (TPdfToolsOcr_PageOptions *pPageOptions)
 The mode for processing pages Default value: ePdfToolsOcr_PageProcessingMode_None.
 
PDFTOOLS_EXPORT BOOL PDFTOOLS_CALL PdfToolsOcr_PageOptions_SetMode (TPdfToolsOcr_PageOptions *pPageOptions, TPdfToolsOcr_PageProcessingMode iMode)
 The mode for processing pages Default value: ePdfToolsOcr_PageProcessingMode_None.
 
PDFTOOLS_EXPORT TPdfToolsOcr_TaggingMode PDFTOOLS_CALL PdfToolsOcr_PageOptions_GetTagging (TPdfToolsOcr_PageOptions *pPageOptions)
 The mode for processing tagging information Default value: ePdfToolsOcr_TaggingMode_Auto.
 
PDFTOOLS_EXPORT BOOL PDFTOOLS_CALL PdfToolsOcr_PageOptions_SetTagging (TPdfToolsOcr_PageOptions *pPageOptions, TPdfToolsOcr_TaggingMode iTagging)
 The mode for processing tagging information Default value: ePdfToolsOcr_TaggingMode_Auto.
 
PDFTOOLS_EXPORT TPdfToolsOcr_OcrOptions *PDFTOOLS_CALL PdfToolsOcr_OcrOptions_New (void)
 
PDFTOOLS_EXPORT double PDFTOOLS_CALL PdfToolsOcr_OcrOptions_GetDpi (TPdfToolsOcr_OcrOptions *pOcrOptions)
 The default resolution in DPI used for OCR.
 
PDFTOOLS_EXPORT BOOL PDFTOOLS_CALL PdfToolsOcr_OcrOptions_SetDpi (TPdfToolsOcr_OcrOptions *pOcrOptions, double dDpi)
 The default resolution in DPI used for OCR.
 
PDFTOOLS_EXPORT double PDFTOOLS_CALL PdfToolsOcr_OcrOptions_GetMinDpi (TPdfToolsOcr_OcrOptions *pOcrOptions)
 The minimum resolution in DPI used for OCR Default value: 200.0.
 
PDFTOOLS_EXPORT BOOL PDFTOOLS_CALL PdfToolsOcr_OcrOptions_SetMinDpi (TPdfToolsOcr_OcrOptions *pOcrOptions, double dMinDpi)
 The minimum resolution in DPI used for OCR Default value: 200.0.
 
PDFTOOLS_EXPORT double PDFTOOLS_CALL PdfToolsOcr_OcrOptions_GetMaxDpi (TPdfToolsOcr_OcrOptions *pOcrOptions)
 The maximum resolution in DPI used for OCR Default value: 400.0.
 
PDFTOOLS_EXPORT BOOL PDFTOOLS_CALL PdfToolsOcr_OcrOptions_SetMaxDpi (TPdfToolsOcr_OcrOptions *pOcrOptions, double dMaxDpi)
 The maximum resolution in DPI used for OCR Default value: 400.0.
 
PDFTOOLS_EXPORT BOOL PDFTOOLS_CALL PdfToolsOcr_OcrOptions_GetProcessEmbeddedFiles (TPdfToolsOcr_OcrOptions *pOcrOptions)
 Whether to process embedded files recursively.
 
PDFTOOLS_EXPORT BOOL PDFTOOLS_CALL PdfToolsOcr_OcrOptions_SetProcessEmbeddedFiles (TPdfToolsOcr_OcrOptions *pOcrOptions, BOOL bProcessEmbeddedFiles)
 Whether to process embedded files recursively.
 
PDFTOOLS_EXPORT TPdfToolsOcr_ImageOptions *PDFTOOLS_CALL PdfToolsOcr_OcrOptions_GetImageOptions (TPdfToolsOcr_OcrOptions *pOcrOptions)
 The options for image processing Options controlling how images in the PDF are processed during OCR.
 
PDFTOOLS_EXPORT TPdfToolsOcr_TextOptions *PDFTOOLS_CALL PdfToolsOcr_OcrOptions_GetTextOptions (TPdfToolsOcr_OcrOptions *pOcrOptions)
 The options for text processing Options controlling how existing text is processed during OCR.
 
PDFTOOLS_EXPORT TPdfToolsOcr_PageOptions *PDFTOOLS_CALL PdfToolsOcr_OcrOptions_GetPageOptions (TPdfToolsOcr_OcrOptions *pOcrOptions)
 The options for page processing Options controlling page-level OCR processing and tagging.
 
PDFTOOLS_EXPORT TPdfToolsOcr_Engine *PDFTOOLS_CALL PdfToolsOcr_Engine_CreateA (const char *szName)
 Create a new OCR engine Optionally the szName argument may be followed by "@" and engine creation parameters, e.g. "service@http://localhost:7982/".
 
PDFTOOLS_EXPORT TPdfToolsOcr_Engine *PDFTOOLS_CALL PdfToolsOcr_Engine_CreateW (const WCHAR *szName)
 Create a new OCR engine Optionally the szName argument may be followed by "@" and engine creation parameters, e.g. "service@http://localhost:7982/".
 
PDFTOOLS_EXPORT size_t PDFTOOLS_CALL PdfToolsOcr_Engine_GetLanguagesA (TPdfToolsOcr_Engine *pEngine, char *pBuffer, size_t nBufferSize)
 The OCR language settings.
 
PDFTOOLS_EXPORT size_t PDFTOOLS_CALL PdfToolsOcr_Engine_GetLanguagesW (TPdfToolsOcr_Engine *pEngine, WCHAR *pBuffer, size_t nBufferSize)
 The OCR language settings.
 
PDFTOOLS_EXPORT BOOL PDFTOOLS_CALL PdfToolsOcr_Engine_SetLanguagesA (TPdfToolsOcr_Engine *pEngine, const char *szLanguages)
 The OCR language settings.
 
PDFTOOLS_EXPORT BOOL PDFTOOLS_CALL PdfToolsOcr_Engine_SetLanguagesW (TPdfToolsOcr_Engine *pEngine, const WCHAR *szLanguages)
 The OCR language settings.
 
PDFTOOLS_EXPORT size_t PDFTOOLS_CALL PdfToolsOcr_Engine_GetParametersA (TPdfToolsOcr_Engine *pEngine, char *pBuffer, size_t nBufferSize)
 Engine-specific parameters.
 
PDFTOOLS_EXPORT size_t PDFTOOLS_CALL PdfToolsOcr_Engine_GetParametersW (TPdfToolsOcr_Engine *pEngine, WCHAR *pBuffer, size_t nBufferSize)
 Engine-specific parameters.
 
PDFTOOLS_EXPORT BOOL PDFTOOLS_CALL PdfToolsOcr_Engine_SetParametersA (TPdfToolsOcr_Engine *pEngine, const char *szParameters)
 Engine-specific parameters.
 
PDFTOOLS_EXPORT BOOL PDFTOOLS_CALL PdfToolsOcr_Engine_SetParametersW (TPdfToolsOcr_Engine *pEngine, const WCHAR *szParameters)
 Engine-specific parameters.
 
PDFTOOLS_EXPORT BOOL PDFTOOLS_CALL PdfToolsOcr_Engine_Close (TPdfToolsOcr_Engine *pObject)
 Close object.
 
PDFTOOLS_EXPORT BOOL PDFTOOLS_CALL PdfToolsOcr_Processor_AddWarningHandlerA (TPdfToolsOcr_Processor *pProcessor, void *pContext, TPdfToolsOcr_Processor_WarningA pFunction)
 Adds event handler.
 
PDFTOOLS_EXPORT BOOL PDFTOOLS_CALL PdfToolsOcr_Processor_AddWarningHandlerW (TPdfToolsOcr_Processor *pProcessor, void *pContext, TPdfToolsOcr_Processor_WarningW pFunction)
 Adds event handler.
 
PDFTOOLS_EXPORT BOOL PDFTOOLS_CALL PdfToolsOcr_Processor_RemoveWarningHandlerA (TPdfToolsOcr_Processor *pProcessor, void *pContext, TPdfToolsOcr_Processor_WarningA pFunction)
 Removes event handler.
 
PDFTOOLS_EXPORT BOOL PDFTOOLS_CALL PdfToolsOcr_Processor_RemoveWarningHandlerW (TPdfToolsOcr_Processor *pProcessor, void *pContext, TPdfToolsOcr_Processor_WarningW pFunction)
 Removes event handler.
 
PDFTOOLS_EXPORT TPdfToolsOcr_Processor *PDFTOOLS_CALL PdfToolsOcr_Processor_New (void)
 
PDFTOOLS_EXPORT TPdfToolsPdf_Document *PDFTOOLS_CALL PdfToolsOcr_Processor_Process (TPdfToolsOcr_Processor *pProcessor, TPdfToolsPdf_Document *pDocument, TPdfToolsOcr_Engine *pEngine, const TPdfToolsSys_StreamDescriptor *pOutStreamDesc, TPdfToolsOcr_OcrOptions *pOptions, TPdfToolsPdf_OutputOptions *pOutOptions)
 Apply OCR to a PDF document.
 

Macro Definition Documentation

◆ PDFTOOLS_CALL

#define PDFTOOLS_CALL

◆ PdfToolsOcr_Engine_Create

#define PdfToolsOcr_Engine_Create   PdfToolsOcr_Engine_CreateA

◆ PdfToolsOcr_Engine_GetLanguages

#define PdfToolsOcr_Engine_GetLanguages   PdfToolsOcr_Engine_GetLanguagesA

◆ PdfToolsOcr_Engine_GetParameters

#define PdfToolsOcr_Engine_GetParameters   PdfToolsOcr_Engine_GetParametersA

◆ PdfToolsOcr_Engine_SetLanguages

#define PdfToolsOcr_Engine_SetLanguages   PdfToolsOcr_Engine_SetLanguagesA

◆ PdfToolsOcr_Engine_SetParameters

#define PdfToolsOcr_Engine_SetParameters   PdfToolsOcr_Engine_SetParametersA

◆ PdfToolsOcr_Processor_AddWarningHandler

#define PdfToolsOcr_Processor_AddWarningHandler   PdfToolsOcr_Processor_AddWarningHandlerA

◆ PdfToolsOcr_Processor_RemoveWarningHandler

#define PdfToolsOcr_Processor_RemoveWarningHandler   PdfToolsOcr_Processor_RemoveWarningHandlerA

◆ TPdfToolsOcr_Processor_Warning

#define TPdfToolsOcr_Processor_Warning   TPdfToolsOcr_Processor_WarningA

Typedef Documentation

◆ TPdfToolsOcr_Processor_WarningA

typedef void(PDFTOOLS_CALL * TPdfToolsOcr_Processor_WarningA) (void *pContext, const char *szMessage, TPdfToolsOcr_WarningCategory iCategory, int iPageNo, const char *szContext)

Event for warnings occurring during OCR processing Non-critical issues during processing are reported via this event. It is recommended to review the TPdfToolsOcr_WarningCategory and handle warnings if necessary for the application.

Parameters
[in,out]pContextContext of the event callback.
[in]szMessageThe message describing the warning
[in]iCategoryThe category of the warning
[in]iPageNoThe page number this warning is associated to, or 0 if not page-specific
[in]szContextA description of the context where the warning occurred

◆ TPdfToolsOcr_Processor_WarningW

typedef void(PDFTOOLS_CALL * TPdfToolsOcr_Processor_WarningW) (void *pContext, const WCHAR *szMessage, TPdfToolsOcr_WarningCategory iCategory, int iPageNo, const WCHAR *szContext)

Event for warnings occurring during OCR processing Non-critical issues during processing are reported via this event. It is recommended to review the TPdfToolsOcr_WarningCategory and handle warnings if necessary for the application.

Parameters
[in,out]pContextContext of the event callback.
[in]szMessageThe message describing the warning
[in]iCategoryThe category of the warning
[in]iPageNoThe page number this warning is associated to, or 0 if not page-specific
[in]szContextA description of the context where the warning occurred

Function Documentation

◆ PdfToolsOcr_Engine_Close()

PDFTOOLS_EXPORT BOOL PDFTOOLS_CALL PdfToolsOcr_Engine_Close ( TPdfToolsOcr_Engine * pObject)

Close object.

Close disposable objects by invoking this function.

Parameters
[in]pObjectDisposable object.
Returns
TRUE if the object was closed successfully; FALSE if an error occured while closing the object. Retrieve the error code by calling PdfTools_GetLastError .

◆ PdfToolsOcr_Engine_CreateA()

PDFTOOLS_EXPORT TPdfToolsOcr_Engine *PDFTOOLS_CALL PdfToolsOcr_Engine_CreateA ( const char * szName)

Create a new OCR engine Optionally the szName argument may be followed by "@" and engine creation parameters, e.g. "service@http://localhost:7982/".

Parameters
[in]szNameThe engine name and optional creation parameters.
Returns
The newly created engine instance.

NULL if there is an error.

Note
An error occurred when NULL was returned. Retrieve specific error code by calling PdfTools_GetLastError. Get the error message with PdfTools_GetLastErrorMessage. Possible error codes:

◆ PdfToolsOcr_Engine_CreateW()

PDFTOOLS_EXPORT TPdfToolsOcr_Engine *PDFTOOLS_CALL PdfToolsOcr_Engine_CreateW ( const WCHAR * szName)

Create a new OCR engine Optionally the szName argument may be followed by "@" and engine creation parameters, e.g. "service@http://localhost:7982/".

Parameters
[in]szNameThe engine name and optional creation parameters.
Returns
The newly created engine instance.

NULL if there is an error.

Note
An error occurred when NULL was returned. Retrieve specific error code by calling PdfTools_GetLastError. Get the error message with PdfTools_GetLastErrorMessage. Possible error codes:

◆ PdfToolsOcr_Engine_GetLanguagesA()

PDFTOOLS_EXPORT size_t PDFTOOLS_CALL PdfToolsOcr_Engine_GetLanguagesA ( TPdfToolsOcr_Engine * pEngine,
char * pBuffer,
size_t nBufferSize )

The OCR language settings.

Set the languages used for recognition to improve detection accuracy. Note that for some engines it is crucial to set the used languages correctly. For example, ABBYY FineReader will only detect characters used in the specified languages.

Multiple languages can be specified as a comma-separated list, e.g. "German,English".

Default value: NULL (engine default)

Parameters
[in,out]pEngineActs as a handle to the native object of type TPdfToolsOcr_Engine.
[out]pBufferRetrieved value. To determine the required buffer size, the function has to be called with NULL. The return value of this function specifies the buffer size.
[in]nBufferSizeThe buffer size of the retrieved string pBuffer.
Returns
The amount of data written to the buffer pBuffer. 0 if either an error occurred or the returned buffer is actually NULL. To determine if an error has occurred, check the error code as described in the note section below.
Note
An error occurred when 0 was returned and the error code returned by PdfTools_GetLastError is different from ePdfTools_Error_Success. Get the error message with PdfTools_GetLastErrorMessage. Possible error codes:

◆ PdfToolsOcr_Engine_GetLanguagesW()

PDFTOOLS_EXPORT size_t PDFTOOLS_CALL PdfToolsOcr_Engine_GetLanguagesW ( TPdfToolsOcr_Engine * pEngine,
WCHAR * pBuffer,
size_t nBufferSize )

The OCR language settings.

Set the languages used for recognition to improve detection accuracy. Note that for some engines it is crucial to set the used languages correctly. For example, ABBYY FineReader will only detect characters used in the specified languages.

Multiple languages can be specified as a comma-separated list, e.g. "German,English".

Default value: NULL (engine default)

Parameters
[in,out]pEngineActs as a handle to the native object of type TPdfToolsOcr_Engine.
[out]pBufferRetrieved value. To determine the required buffer size, the function has to be called with NULL. The return value of this function specifies the buffer size.
[in]nBufferSizeThe buffer size of the retrieved string pBuffer.
Returns
The amount of data written to the buffer pBuffer. 0 if either an error occurred or the returned buffer is actually NULL. To determine if an error has occurred, check the error code as described in the note section below.
Note
An error occurred when 0 was returned and the error code returned by PdfTools_GetLastError is different from ePdfTools_Error_Success. Get the error message with PdfTools_GetLastErrorMessage. Possible error codes:

◆ PdfToolsOcr_Engine_GetParametersA()

PDFTOOLS_EXPORT size_t PDFTOOLS_CALL PdfToolsOcr_Engine_GetParametersA ( TPdfToolsOcr_Engine * pEngine,
char * pBuffer,
size_t nBufferSize )

Engine-specific parameters.

OCR engine-specific parameters can be set to optimize performance or activate optional recognition features.

Parameters are specified as semicolon-separated key=value pairs, e.g. "PredefinedProfile=Default;Profile=/path/to/profile.ini". The available parameters depend on the OCR engine. Commonly supported parameters include:

  • "PredefinedProfile": Name of a predefined recognition profile (default: "Default").
  • "Profile": Path to a custom profile file. Applied after the predefined profile.

Parameter keys are case-sensitive.

Default value: NULL

Parameters
[in,out]pEngineActs as a handle to the native object of type TPdfToolsOcr_Engine.
[out]pBufferRetrieved value. To determine the required buffer size, the function has to be called with NULL. The return value of this function specifies the buffer size.
[in]nBufferSizeThe buffer size of the retrieved string pBuffer.
Returns
The amount of data written to the buffer pBuffer. 0 if either an error occurred or the returned buffer is actually NULL. To determine if an error has occurred, check the error code as described in the note section below.
Note
An error occurred when 0 was returned and the error code returned by PdfTools_GetLastError is different from ePdfTools_Error_Success. Get the error message with PdfTools_GetLastErrorMessage. Possible error codes:

◆ PdfToolsOcr_Engine_GetParametersW()

PDFTOOLS_EXPORT size_t PDFTOOLS_CALL PdfToolsOcr_Engine_GetParametersW ( TPdfToolsOcr_Engine * pEngine,
WCHAR * pBuffer,
size_t nBufferSize )

Engine-specific parameters.

OCR engine-specific parameters can be set to optimize performance or activate optional recognition features.

Parameters are specified as semicolon-separated key=value pairs, e.g. "PredefinedProfile=Default;Profile=/path/to/profile.ini". The available parameters depend on the OCR engine. Commonly supported parameters include:

  • "PredefinedProfile": Name of a predefined recognition profile (default: "Default").
  • "Profile": Path to a custom profile file. Applied after the predefined profile.

Parameter keys are case-sensitive.

Default value: NULL

Parameters
[in,out]pEngineActs as a handle to the native object of type TPdfToolsOcr_Engine.
[out]pBufferRetrieved value. To determine the required buffer size, the function has to be called with NULL. The return value of this function specifies the buffer size.
[in]nBufferSizeThe buffer size of the retrieved string pBuffer.
Returns
The amount of data written to the buffer pBuffer. 0 if either an error occurred or the returned buffer is actually NULL. To determine if an error has occurred, check the error code as described in the note section below.
Note
An error occurred when 0 was returned and the error code returned by PdfTools_GetLastError is different from ePdfTools_Error_Success. Get the error message with PdfTools_GetLastErrorMessage. Possible error codes:

◆ PdfToolsOcr_Engine_SetLanguagesA()

PDFTOOLS_EXPORT BOOL PDFTOOLS_CALL PdfToolsOcr_Engine_SetLanguagesA ( TPdfToolsOcr_Engine * pEngine,
const char * szLanguages )

The OCR language settings.

Set the languages used for recognition to improve detection accuracy. Note that for some engines it is crucial to set the used languages correctly. For example, ABBYY FineReader will only detect characters used in the specified languages.

Multiple languages can be specified as a comma-separated list, e.g. "German,English".

Default value: NULL (engine default)

Parameters
[in,out]pEngineActs as a handle to the native object of type TPdfToolsOcr_Engine.
[in]szLanguagesSet value.
Returns
TRUE if the operation is successful; FALSE if there is an error.
Note
An error occurred when FALSE was returned. Retrieve specific error code by calling PdfTools_GetLastError. Get the error message with PdfTools_GetLastErrorMessage. Possible error codes:

◆ PdfToolsOcr_Engine_SetLanguagesW()

PDFTOOLS_EXPORT BOOL PDFTOOLS_CALL PdfToolsOcr_Engine_SetLanguagesW ( TPdfToolsOcr_Engine * pEngine,
const WCHAR * szLanguages )

The OCR language settings.

Set the languages used for recognition to improve detection accuracy. Note that for some engines it is crucial to set the used languages correctly. For example, ABBYY FineReader will only detect characters used in the specified languages.

Multiple languages can be specified as a comma-separated list, e.g. "German,English".

Default value: NULL (engine default)

Parameters
[in,out]pEngineActs as a handle to the native object of type TPdfToolsOcr_Engine.
[in]szLanguagesSet value.
Returns
TRUE if the operation is successful; FALSE if there is an error.
Note
An error occurred when FALSE was returned. Retrieve specific error code by calling PdfTools_GetLastError. Get the error message with PdfTools_GetLastErrorMessage. Possible error codes:

◆ PdfToolsOcr_Engine_SetParametersA()

PDFTOOLS_EXPORT BOOL PDFTOOLS_CALL PdfToolsOcr_Engine_SetParametersA ( TPdfToolsOcr_Engine * pEngine,
const char * szParameters )

Engine-specific parameters.

OCR engine-specific parameters can be set to optimize performance or activate optional recognition features.

Parameters are specified as semicolon-separated key=value pairs, e.g. "PredefinedProfile=Default;Profile=/path/to/profile.ini". The available parameters depend on the OCR engine. Commonly supported parameters include:

  • "PredefinedProfile": Name of a predefined recognition profile (default: "Default").
  • "Profile": Path to a custom profile file. Applied after the predefined profile.

Parameter keys are case-sensitive.

Default value: NULL

Parameters
[in,out]pEngineActs as a handle to the native object of type TPdfToolsOcr_Engine.
[in]szParametersSet value.
Returns
TRUE if the operation is successful; FALSE if there is an error.
Note
An error occurred when FALSE was returned. Retrieve specific error code by calling PdfTools_GetLastError. Get the error message with PdfTools_GetLastErrorMessage. Possible error codes:

◆ PdfToolsOcr_Engine_SetParametersW()

PDFTOOLS_EXPORT BOOL PDFTOOLS_CALL PdfToolsOcr_Engine_SetParametersW ( TPdfToolsOcr_Engine * pEngine,
const WCHAR * szParameters )

Engine-specific parameters.

OCR engine-specific parameters can be set to optimize performance or activate optional recognition features.

Parameters are specified as semicolon-separated key=value pairs, e.g. "PredefinedProfile=Default;Profile=/path/to/profile.ini". The available parameters depend on the OCR engine. Commonly supported parameters include:

  • "PredefinedProfile": Name of a predefined recognition profile (default: "Default").
  • "Profile": Path to a custom profile file. Applied after the predefined profile.

Parameter keys are case-sensitive.

Default value: NULL

Parameters
[in,out]pEngineActs as a handle to the native object of type TPdfToolsOcr_Engine.
[in]szParametersSet value.
Returns
TRUE if the operation is successful; FALSE if there is an error.
Note
An error occurred when FALSE was returned. Retrieve specific error code by calling PdfTools_GetLastError. Get the error message with PdfTools_GetLastErrorMessage. Possible error codes:

◆ PdfToolsOcr_ImageOptions_GetDeskewScan()

PDFTOOLS_EXPORT BOOL PDFTOOLS_CALL PdfToolsOcr_ImageOptions_GetDeskewScan ( TPdfToolsOcr_ImageOptions * pImageOptions)

Whether to deskew scanned pages.

This option has an effect only if the required information is provided by the OCR engine, which depends on the type and settings of the engine.

Default value: FALSE

Parameters
[in,out]pImageOptionsActs as a handle to the native object of type TPdfToolsOcr_ImageOptions.
Returns
Retrieved value.

May indicate an error in certain scenarios. For further information see the note section below.

Note
An error occurred when FALSE was returned and the error code returned by PdfTools_GetLastError is different from ePdfTools_Error_Success. Get the error message with PdfTools_GetLastErrorMessage.

◆ PdfToolsOcr_ImageOptions_GetMode()

PDFTOOLS_EXPORT TPdfToolsOcr_ImageProcessingMode PDFTOOLS_CALL PdfToolsOcr_ImageOptions_GetMode ( TPdfToolsOcr_ImageOptions * pImageOptions)

The mode for processing images Default value: ePdfToolsOcr_ImageProcessingMode_None.

Parameters
[in,out]pImageOptionsActs as a handle to the native object of type TPdfToolsOcr_ImageOptions.
Returns
Retrieved value.

May indicate an error in certain scenarios. For further information see the note section below.

Note
An error occurred when 0 was returned. Retrieve specific error code by calling PdfTools_GetLastError. Get the error message with PdfTools_GetLastErrorMessage.

◆ PdfToolsOcr_ImageOptions_GetRemoveOnlyInvisibleOcrText()

PDFTOOLS_EXPORT BOOL PDFTOOLS_CALL PdfToolsOcr_ImageOptions_GetRemoveOnlyInvisibleOcrText ( TPdfToolsOcr_ImageOptions * pImageOptions)

Whether to remove only invisible OCR text (text rendering mode 3)

When used with ePdfToolsOcr_ImageProcessingMode_ReplaceText or ePdfToolsOcr_ImageProcessingMode_RemoveText, only the invisible text layer typically added by OCR engines is removed, while other text is preserved.

Default value: FALSE

Parameters
[in,out]pImageOptionsActs as a handle to the native object of type TPdfToolsOcr_ImageOptions.
Returns
Retrieved value.

May indicate an error in certain scenarios. For further information see the note section below.

Note
An error occurred when FALSE was returned and the error code returned by PdfTools_GetLastError is different from ePdfTools_Error_Success. Get the error message with PdfTools_GetLastErrorMessage.

◆ PdfToolsOcr_ImageOptions_GetRotateScan()

PDFTOOLS_EXPORT BOOL PDFTOOLS_CALL PdfToolsOcr_ImageOptions_GetRotateScan ( TPdfToolsOcr_ImageOptions * pImageOptions)

Whether to rotate scanned pages based on detected orientation.

This option has an effect only if the required information is provided by the OCR engine, which depends on the type and settings of the engine.

Default value: FALSE

Parameters
[in,out]pImageOptionsActs as a handle to the native object of type TPdfToolsOcr_ImageOptions.
Returns
Retrieved value.

May indicate an error in certain scenarios. For further information see the note section below.

Note
An error occurred when FALSE was returned and the error code returned by PdfTools_GetLastError is different from ePdfTools_Error_Success. Get the error message with PdfTools_GetLastErrorMessage.

◆ PdfToolsOcr_ImageOptions_New()

PDFTOOLS_EXPORT TPdfToolsOcr_ImageOptions *PDFTOOLS_CALL PdfToolsOcr_ImageOptions_New ( void )
Returns
Handle to the newly created native object.

NULL if there is an error.

Note
An error occurred when NULL was returned. Retrieve specific error code by calling PdfTools_GetLastError. Get the error message with PdfTools_GetLastErrorMessage.

◆ PdfToolsOcr_ImageOptions_SetDeskewScan()

PDFTOOLS_EXPORT BOOL PDFTOOLS_CALL PdfToolsOcr_ImageOptions_SetDeskewScan ( TPdfToolsOcr_ImageOptions * pImageOptions,
BOOL bDeskewScan )

Whether to deskew scanned pages.

This option has an effect only if the required information is provided by the OCR engine, which depends on the type and settings of the engine.

Default value: FALSE

Parameters
[in,out]pImageOptionsActs as a handle to the native object of type TPdfToolsOcr_ImageOptions.
[in]bDeskewScanSet value.
Returns
TRUE if the operation is successful; FALSE if there is an error.
Note
An error occurred when FALSE was returned. Retrieve specific error code by calling PdfTools_GetLastError. Get the error message with PdfTools_GetLastErrorMessage.

◆ PdfToolsOcr_ImageOptions_SetMode()

PDFTOOLS_EXPORT BOOL PDFTOOLS_CALL PdfToolsOcr_ImageOptions_SetMode ( TPdfToolsOcr_ImageOptions * pImageOptions,
TPdfToolsOcr_ImageProcessingMode iMode )

The mode for processing images Default value: ePdfToolsOcr_ImageProcessingMode_None.

Parameters
[in,out]pImageOptionsActs as a handle to the native object of type TPdfToolsOcr_ImageOptions.
[in]iModeSet value.
Returns
TRUE if the operation is successful; FALSE if there is an error.
Note
An error occurred when FALSE was returned. Retrieve specific error code by calling PdfTools_GetLastError. Get the error message with PdfTools_GetLastErrorMessage.

◆ PdfToolsOcr_ImageOptions_SetRemoveOnlyInvisibleOcrText()

PDFTOOLS_EXPORT BOOL PDFTOOLS_CALL PdfToolsOcr_ImageOptions_SetRemoveOnlyInvisibleOcrText ( TPdfToolsOcr_ImageOptions * pImageOptions,
BOOL bRemoveOnlyInvisibleOcrText )

Whether to remove only invisible OCR text (text rendering mode 3)

When used with ePdfToolsOcr_ImageProcessingMode_ReplaceText or ePdfToolsOcr_ImageProcessingMode_RemoveText, only the invisible text layer typically added by OCR engines is removed, while other text is preserved.

Default value: FALSE

Parameters
[in,out]pImageOptionsActs as a handle to the native object of type TPdfToolsOcr_ImageOptions.
[in]bRemoveOnlyInvisibleOcrTextSet value.
Returns
TRUE if the operation is successful; FALSE if there is an error.
Note
An error occurred when FALSE was returned. Retrieve specific error code by calling PdfTools_GetLastError. Get the error message with PdfTools_GetLastErrorMessage.

◆ PdfToolsOcr_ImageOptions_SetRotateScan()

PDFTOOLS_EXPORT BOOL PDFTOOLS_CALL PdfToolsOcr_ImageOptions_SetRotateScan ( TPdfToolsOcr_ImageOptions * pImageOptions,
BOOL bRotateScan )

Whether to rotate scanned pages based on detected orientation.

This option has an effect only if the required information is provided by the OCR engine, which depends on the type and settings of the engine.

Default value: FALSE

Parameters
[in,out]pImageOptionsActs as a handle to the native object of type TPdfToolsOcr_ImageOptions.
[in]bRotateScanSet value.
Returns
TRUE if the operation is successful; FALSE if there is an error.
Note
An error occurred when FALSE was returned. Retrieve specific error code by calling PdfTools_GetLastError. Get the error message with PdfTools_GetLastErrorMessage.

◆ PdfToolsOcr_OcrOptions_GetDpi()

PDFTOOLS_EXPORT double PDFTOOLS_CALL PdfToolsOcr_OcrOptions_GetDpi ( TPdfToolsOcr_OcrOptions * pOcrOptions)

The default resolution in DPI used for OCR.

Each page's optimal OCR resolution is determined automatically, such that all images and text can be recognized. The default resolution is chosen if it is within the range of optimal resolutions.

The range should be within the resolutions supported by the OCR engine. Most OCR engines are optimized for resolutions around 300 DPI.

Default value: 300.0

Parameters
[in,out]pOcrOptionsActs as a handle to the native object of type TPdfToolsOcr_OcrOptions.
Returns
Retrieved value.

May indicate an error in certain scenarios. For further information see the note section below.

Note
An error occurred when -1.0 was returned. Retrieve specific error code by calling PdfTools_GetLastError. Get the error message with PdfTools_GetLastErrorMessage. Possible error codes:

◆ PdfToolsOcr_OcrOptions_GetImageOptions()

PDFTOOLS_EXPORT TPdfToolsOcr_ImageOptions *PDFTOOLS_CALL PdfToolsOcr_OcrOptions_GetImageOptions ( TPdfToolsOcr_OcrOptions * pOcrOptions)

The options for image processing Options controlling how images in the PDF are processed during OCR.

Parameters
[in,out]pOcrOptionsActs as a handle to the native object of type TPdfToolsOcr_OcrOptions.
Returns
Retrieved value.

NULL if there is an error.

Note
An error occurred when NULL was returned. Retrieve specific error code by calling PdfTools_GetLastError. Get the error message with PdfTools_GetLastErrorMessage.

◆ PdfToolsOcr_OcrOptions_GetMaxDpi()

PDFTOOLS_EXPORT double PDFTOOLS_CALL PdfToolsOcr_OcrOptions_GetMaxDpi ( TPdfToolsOcr_OcrOptions * pOcrOptions)

The maximum resolution in DPI used for OCR Default value: 400.0.

Parameters
[in,out]pOcrOptionsActs as a handle to the native object of type TPdfToolsOcr_OcrOptions.
Returns
Retrieved value.

May indicate an error in certain scenarios. For further information see the note section below.

Note
An error occurred when -1.0 was returned. Retrieve specific error code by calling PdfTools_GetLastError. Get the error message with PdfTools_GetLastErrorMessage. Possible error codes:

◆ PdfToolsOcr_OcrOptions_GetMinDpi()

PDFTOOLS_EXPORT double PDFTOOLS_CALL PdfToolsOcr_OcrOptions_GetMinDpi ( TPdfToolsOcr_OcrOptions * pOcrOptions)

The minimum resolution in DPI used for OCR Default value: 200.0.

Parameters
[in,out]pOcrOptionsActs as a handle to the native object of type TPdfToolsOcr_OcrOptions.
Returns
Retrieved value.

May indicate an error in certain scenarios. For further information see the note section below.

Note
An error occurred when -1.0 was returned. Retrieve specific error code by calling PdfTools_GetLastError. Get the error message with PdfTools_GetLastErrorMessage. Possible error codes:

◆ PdfToolsOcr_OcrOptions_GetPageOptions()

PDFTOOLS_EXPORT TPdfToolsOcr_PageOptions *PDFTOOLS_CALL PdfToolsOcr_OcrOptions_GetPageOptions ( TPdfToolsOcr_OcrOptions * pOcrOptions)

The options for page processing Options controlling page-level OCR processing and tagging.

Parameters
[in,out]pOcrOptionsActs as a handle to the native object of type TPdfToolsOcr_OcrOptions.
Returns
Retrieved value.

NULL if there is an error.

Note
An error occurred when NULL was returned. Retrieve specific error code by calling PdfTools_GetLastError. Get the error message with PdfTools_GetLastErrorMessage.

◆ PdfToolsOcr_OcrOptions_GetProcessEmbeddedFiles()

PDFTOOLS_EXPORT BOOL PDFTOOLS_CALL PdfToolsOcr_OcrOptions_GetProcessEmbeddedFiles ( TPdfToolsOcr_OcrOptions * pOcrOptions)

Whether to process embedded files recursively.

If enabled, embedded PDF files are also processed with OCR. The default is to copy all embedded files as-is.

Default value: FALSE

Parameters
[in,out]pOcrOptionsActs as a handle to the native object of type TPdfToolsOcr_OcrOptions.
Returns
Retrieved value.

May indicate an error in certain scenarios. For further information see the note section below.

Note
An error occurred when FALSE was returned and the error code returned by PdfTools_GetLastError is different from ePdfTools_Error_Success. Get the error message with PdfTools_GetLastErrorMessage.

◆ PdfToolsOcr_OcrOptions_GetTextOptions()

PDFTOOLS_EXPORT TPdfToolsOcr_TextOptions *PDFTOOLS_CALL PdfToolsOcr_OcrOptions_GetTextOptions ( TPdfToolsOcr_OcrOptions * pOcrOptions)

The options for text processing Options controlling how existing text is processed during OCR.

Parameters
[in,out]pOcrOptionsActs as a handle to the native object of type TPdfToolsOcr_OcrOptions.
Returns
Retrieved value.

NULL if there is an error.

Note
An error occurred when NULL was returned. Retrieve specific error code by calling PdfTools_GetLastError. Get the error message with PdfTools_GetLastErrorMessage.

◆ PdfToolsOcr_OcrOptions_New()

PDFTOOLS_EXPORT TPdfToolsOcr_OcrOptions *PDFTOOLS_CALL PdfToolsOcr_OcrOptions_New ( void )
Returns
Handle to the newly created native object.

NULL if there is an error.

Note
An error occurred when NULL was returned. Retrieve specific error code by calling PdfTools_GetLastError. Get the error message with PdfTools_GetLastErrorMessage.

◆ PdfToolsOcr_OcrOptions_SetDpi()

PDFTOOLS_EXPORT BOOL PDFTOOLS_CALL PdfToolsOcr_OcrOptions_SetDpi ( TPdfToolsOcr_OcrOptions * pOcrOptions,
double dDpi )

The default resolution in DPI used for OCR.

Each page's optimal OCR resolution is determined automatically, such that all images and text can be recognized. The default resolution is chosen if it is within the range of optimal resolutions.

The range should be within the resolutions supported by the OCR engine. Most OCR engines are optimized for resolutions around 300 DPI.

Default value: 300.0

Parameters
[in,out]pOcrOptionsActs as a handle to the native object of type TPdfToolsOcr_OcrOptions.
[in]dDpiSet value.
Returns
TRUE if the operation is successful; FALSE if there is an error.
Note
An error occurred when FALSE was returned. Retrieve specific error code by calling PdfTools_GetLastError. Get the error message with PdfTools_GetLastErrorMessage. Possible error codes:

◆ PdfToolsOcr_OcrOptions_SetMaxDpi()

PDFTOOLS_EXPORT BOOL PDFTOOLS_CALL PdfToolsOcr_OcrOptions_SetMaxDpi ( TPdfToolsOcr_OcrOptions * pOcrOptions,
double dMaxDpi )

The maximum resolution in DPI used for OCR Default value: 400.0.

Parameters
[in,out]pOcrOptionsActs as a handle to the native object of type TPdfToolsOcr_OcrOptions.
[in]dMaxDpiSet value.
Returns
TRUE if the operation is successful; FALSE if there is an error.
Note
An error occurred when FALSE was returned. Retrieve specific error code by calling PdfTools_GetLastError. Get the error message with PdfTools_GetLastErrorMessage. Possible error codes:

◆ PdfToolsOcr_OcrOptions_SetMinDpi()

PDFTOOLS_EXPORT BOOL PDFTOOLS_CALL PdfToolsOcr_OcrOptions_SetMinDpi ( TPdfToolsOcr_OcrOptions * pOcrOptions,
double dMinDpi )

The minimum resolution in DPI used for OCR Default value: 200.0.

Parameters
[in,out]pOcrOptionsActs as a handle to the native object of type TPdfToolsOcr_OcrOptions.
[in]dMinDpiSet value.
Returns
TRUE if the operation is successful; FALSE if there is an error.
Note
An error occurred when FALSE was returned. Retrieve specific error code by calling PdfTools_GetLastError. Get the error message with PdfTools_GetLastErrorMessage. Possible error codes:

◆ PdfToolsOcr_OcrOptions_SetProcessEmbeddedFiles()

PDFTOOLS_EXPORT BOOL PDFTOOLS_CALL PdfToolsOcr_OcrOptions_SetProcessEmbeddedFiles ( TPdfToolsOcr_OcrOptions * pOcrOptions,
BOOL bProcessEmbeddedFiles )

Whether to process embedded files recursively.

If enabled, embedded PDF files are also processed with OCR. The default is to copy all embedded files as-is.

Default value: FALSE

Parameters
[in,out]pOcrOptionsActs as a handle to the native object of type TPdfToolsOcr_OcrOptions.
[in]bProcessEmbeddedFilesSet value.
Returns
TRUE if the operation is successful; FALSE if there is an error.
Note
An error occurred when FALSE was returned. Retrieve specific error code by calling PdfTools_GetLastError. Get the error message with PdfTools_GetLastErrorMessage.

◆ PdfToolsOcr_PageOptions_GetMode()

The mode for processing pages Default value: ePdfToolsOcr_PageProcessingMode_None.

Parameters
[in,out]pPageOptionsActs as a handle to the native object of type TPdfToolsOcr_PageOptions.
Returns
Retrieved value.

May indicate an error in certain scenarios. For further information see the note section below.

Note
An error occurred when 0 was returned. Retrieve specific error code by calling PdfTools_GetLastError. Get the error message with PdfTools_GetLastErrorMessage.

◆ PdfToolsOcr_PageOptions_GetTagging()

PDFTOOLS_EXPORT TPdfToolsOcr_TaggingMode PDFTOOLS_CALL PdfToolsOcr_PageOptions_GetTagging ( TPdfToolsOcr_PageOptions * pPageOptions)

The mode for processing tagging information Default value: ePdfToolsOcr_TaggingMode_Auto.

Parameters
[in,out]pPageOptionsActs as a handle to the native object of type TPdfToolsOcr_PageOptions.
Returns
Retrieved value.

May indicate an error in certain scenarios. For further information see the note section below.

Note
An error occurred when 0 was returned. Retrieve specific error code by calling PdfTools_GetLastError. Get the error message with PdfTools_GetLastErrorMessage.

◆ PdfToolsOcr_PageOptions_New()

PDFTOOLS_EXPORT TPdfToolsOcr_PageOptions *PDFTOOLS_CALL PdfToolsOcr_PageOptions_New ( void )
Returns
Handle to the newly created native object.

NULL if there is an error.

Note
An error occurred when NULL was returned. Retrieve specific error code by calling PdfTools_GetLastError. Get the error message with PdfTools_GetLastErrorMessage.

◆ PdfToolsOcr_PageOptions_SetMode()

PDFTOOLS_EXPORT BOOL PDFTOOLS_CALL PdfToolsOcr_PageOptions_SetMode ( TPdfToolsOcr_PageOptions * pPageOptions,
TPdfToolsOcr_PageProcessingMode iMode )

The mode for processing pages Default value: ePdfToolsOcr_PageProcessingMode_None.

Parameters
[in,out]pPageOptionsActs as a handle to the native object of type TPdfToolsOcr_PageOptions.
[in]iModeSet value.
Returns
TRUE if the operation is successful; FALSE if there is an error.
Note
An error occurred when FALSE was returned. Retrieve specific error code by calling PdfTools_GetLastError. Get the error message with PdfTools_GetLastErrorMessage.

◆ PdfToolsOcr_PageOptions_SetTagging()

PDFTOOLS_EXPORT BOOL PDFTOOLS_CALL PdfToolsOcr_PageOptions_SetTagging ( TPdfToolsOcr_PageOptions * pPageOptions,
TPdfToolsOcr_TaggingMode iTagging )

The mode for processing tagging information Default value: ePdfToolsOcr_TaggingMode_Auto.

Parameters
[in,out]pPageOptionsActs as a handle to the native object of type TPdfToolsOcr_PageOptions.
[in]iTaggingSet value.
Returns
TRUE if the operation is successful; FALSE if there is an error.
Note
An error occurred when FALSE was returned. Retrieve specific error code by calling PdfTools_GetLastError. Get the error message with PdfTools_GetLastErrorMessage.

◆ PdfToolsOcr_Processor_AddWarningHandlerA()

PDFTOOLS_EXPORT BOOL PDFTOOLS_CALL PdfToolsOcr_Processor_AddWarningHandlerA ( TPdfToolsOcr_Processor * pProcessor,
void * pContext,
TPdfToolsOcr_Processor_WarningA pFunction )

Adds event handler.

Parameters
[in,out]pProcessorPointer to the object to which the event handler is added.
[in,out]pContextThe context of the event handler.
[in]pFunctionThe event callback that is added.
Returns
TRUE if adding event handler was successful; FALSE if error occured.
Note
In case of an error, Retrieve specific error code by calling PdfTools_GetLastError. Get the error message with PdfTools_GetLastErrorMessage.

◆ PdfToolsOcr_Processor_AddWarningHandlerW()

PDFTOOLS_EXPORT BOOL PDFTOOLS_CALL PdfToolsOcr_Processor_AddWarningHandlerW ( TPdfToolsOcr_Processor * pProcessor,
void * pContext,
TPdfToolsOcr_Processor_WarningW pFunction )

Adds event handler.

Parameters
[in,out]pProcessorPointer to the object to which the event handler is added.
[in,out]pContextThe context of the event handler.
[in]pFunctionThe event callback that is added.
Returns
TRUE if adding event handler was successful; FALSE if error occured.
Note
In case of an error, Retrieve specific error code by calling PdfTools_GetLastError. Get the error message with PdfTools_GetLastErrorMessage.

◆ PdfToolsOcr_Processor_New()

PDFTOOLS_EXPORT TPdfToolsOcr_Processor *PDFTOOLS_CALL PdfToolsOcr_Processor_New ( void )
Returns
Handle to the newly created native object.

NULL if there is an error.

Note
An error occurred when NULL was returned. Retrieve specific error code by calling PdfTools_GetLastError. Get the error message with PdfTools_GetLastErrorMessage.

◆ PdfToolsOcr_Processor_Process()

PDFTOOLS_EXPORT TPdfToolsPdf_Document *PDFTOOLS_CALL PdfToolsOcr_Processor_Process ( TPdfToolsOcr_Processor * pProcessor,
TPdfToolsPdf_Document * pDocument,
TPdfToolsOcr_Engine * pEngine,
const TPdfToolsSys_StreamDescriptor * pOutStreamDesc,
TPdfToolsOcr_OcrOptions * pOptions,
TPdfToolsPdf_OutputOptions * pOutOptions )

Apply OCR to a PDF document.

Process the input PDF document with OCR according to the specified options. The processed document is written to the output stream.

Non-critical processing issues raise a TPdfToolsOcr_Processor_Warning. It is recommended to review the TPdfToolsOcr_WarningCategory and handle them if necessary for the application.

Parameters
[in,out]pProcessorActs as a handle to the native object of type TPdfToolsOcr_Processor.
[in,out]pDocumentThe input PDF document to process
[in,out]pEngineThe OCR engine to use for recognition. This parameter may be NULL for operations that do not require OCR, such as ePdfToolsOcr_ImageProcessingMode_RemoveText. For all other modes, a valid engine must be provided.
[in,out]pOutStreamDescThe stream to which the output PDF is written. The stream must support both random read and write access.
[in,out]pOptionsThe OCR processing options. If NULL, default options are used.
[in,out]pOutOptionsThe PDF output options, e.g. to encrypt the output document.
Returns
The resulting output PDF which can be used as a new input for further processing.

Note that this object must be disposed before the output stream object (method argument pOutStreamDesc).

NULL if there is an error.

Note
An error occurred when NULL was returned. Retrieve specific error code by calling PdfTools_GetLastError. Get the error message with PdfTools_GetLastErrorMessage. Possible error codes:

◆ PdfToolsOcr_Processor_RemoveWarningHandlerA()

PDFTOOLS_EXPORT BOOL PDFTOOLS_CALL PdfToolsOcr_Processor_RemoveWarningHandlerA ( TPdfToolsOcr_Processor * pProcessor,
void * pContext,
TPdfToolsOcr_Processor_WarningA pFunction )

Removes event handler.

Parameters
[in,out]pProcessorPointer to the object from which the event handler is removed.
[in,out]pContextThe context of the event handler.
[in]pFunctionThe event callback that is removed.
Returns
TRUE if removal was successful; FALSE if error occured.
Note
In case of an error, Retrieve specific error code by calling PdfTools_GetLastError. Get the error message with PdfTools_GetLastErrorMessage.

◆ PdfToolsOcr_Processor_RemoveWarningHandlerW()

PDFTOOLS_EXPORT BOOL PDFTOOLS_CALL PdfToolsOcr_Processor_RemoveWarningHandlerW ( TPdfToolsOcr_Processor * pProcessor,
void * pContext,
TPdfToolsOcr_Processor_WarningW pFunction )

Removes event handler.

Parameters
[in,out]pProcessorPointer to the object from which the event handler is removed.
[in,out]pContextThe context of the event handler.
[in]pFunctionThe event callback that is removed.
Returns
TRUE if removal was successful; FALSE if error occured.
Note
In case of an error, Retrieve specific error code by calling PdfTools_GetLastError. Get the error message with PdfTools_GetLastErrorMessage.

◆ PdfToolsOcr_TextOptions_GetMode()

The mode for processing text Default value: ePdfToolsOcr_TextProcessingMode_None.

Parameters
[in,out]pTextOptionsActs as a handle to the native object of type TPdfToolsOcr_TextOptions.
Returns
Retrieved value.

May indicate an error in certain scenarios. For further information see the note section below.

Note
An error occurred when 0 was returned. Retrieve specific error code by calling PdfTools_GetLastError. Get the error message with PdfTools_GetLastErrorMessage.

◆ PdfToolsOcr_TextOptions_GetSkipMode()

PDFTOOLS_EXPORT TPdfToolsOcr_TextSkipMode PDFTOOLS_CALL PdfToolsOcr_TextOptions_GetSkipMode ( TPdfToolsOcr_TextOptions * pTextOptions)

Define text that can be skipped from text OCR processing Default value: ePdfToolsOcr_TextSkipMode_None.

Parameters
[in,out]pTextOptionsActs as a handle to the native object of type TPdfToolsOcr_TextOptions.
Returns
Retrieved value.

May indicate an error in certain scenarios. For further information see the note section below.

Note
An error occurred when 0 was returned. Retrieve specific error code by calling PdfTools_GetLastError. Get the error message with PdfTools_GetLastErrorMessage.

◆ PdfToolsOcr_TextOptions_GetUnicodeSource()

PDFTOOLS_EXPORT TPdfToolsOcr_UnicodeSource PDFTOOLS_CALL PdfToolsOcr_TextOptions_GetUnicodeSource ( TPdfToolsOcr_TextOptions * pTextOptions)

Define additional ToUnicode sources in addition to OCR processing Default value: ePdfToolsOcr_UnicodeSource_None.

Parameters
[in,out]pTextOptionsActs as a handle to the native object of type TPdfToolsOcr_TextOptions.
Returns
Retrieved value.

May indicate an error in certain scenarios. For further information see the note section below.

Note
An error occurred when 0 was returned. Retrieve specific error code by calling PdfTools_GetLastError. Get the error message with PdfTools_GetLastErrorMessage.

◆ PdfToolsOcr_TextOptions_New()

PDFTOOLS_EXPORT TPdfToolsOcr_TextOptions *PDFTOOLS_CALL PdfToolsOcr_TextOptions_New ( void )
Returns
Handle to the newly created native object.

NULL if there is an error.

Note
An error occurred when NULL was returned. Retrieve specific error code by calling PdfTools_GetLastError. Get the error message with PdfTools_GetLastErrorMessage.

◆ PdfToolsOcr_TextOptions_SetMode()

PDFTOOLS_EXPORT BOOL PDFTOOLS_CALL PdfToolsOcr_TextOptions_SetMode ( TPdfToolsOcr_TextOptions * pTextOptions,
TPdfToolsOcr_TextProcessingMode iMode )

The mode for processing text Default value: ePdfToolsOcr_TextProcessingMode_None.

Parameters
[in,out]pTextOptionsActs as a handle to the native object of type TPdfToolsOcr_TextOptions.
[in]iModeSet value.
Returns
TRUE if the operation is successful; FALSE if there is an error.
Note
An error occurred when FALSE was returned. Retrieve specific error code by calling PdfTools_GetLastError. Get the error message with PdfTools_GetLastErrorMessage.

◆ PdfToolsOcr_TextOptions_SetSkipMode()

PDFTOOLS_EXPORT BOOL PDFTOOLS_CALL PdfToolsOcr_TextOptions_SetSkipMode ( TPdfToolsOcr_TextOptions * pTextOptions,
TPdfToolsOcr_TextSkipMode iSkipMode )

Define text that can be skipped from text OCR processing Default value: ePdfToolsOcr_TextSkipMode_None.

Parameters
[in,out]pTextOptionsActs as a handle to the native object of type TPdfToolsOcr_TextOptions.
[in]iSkipModeSet value.
Returns
TRUE if the operation is successful; FALSE if there is an error.
Note
An error occurred when FALSE was returned. Retrieve specific error code by calling PdfTools_GetLastError. Get the error message with PdfTools_GetLastErrorMessage.

◆ PdfToolsOcr_TextOptions_SetUnicodeSource()

PDFTOOLS_EXPORT BOOL PDFTOOLS_CALL PdfToolsOcr_TextOptions_SetUnicodeSource ( TPdfToolsOcr_TextOptions * pTextOptions,
TPdfToolsOcr_UnicodeSource iUnicodeSource )

Define additional ToUnicode sources in addition to OCR processing Default value: ePdfToolsOcr_UnicodeSource_None.

Parameters
[in,out]pTextOptionsActs as a handle to the native object of type TPdfToolsOcr_TextOptions.
[in]iUnicodeSourceSet value.
Returns
TRUE if the operation is successful; FALSE if there is an error.
Note
An error occurred when FALSE was returned. Retrieve specific error code by calling PdfTools_GetLastError. Get the error message with PdfTools_GetLastErrorMessage.