Skip to Content

OCR Components and Deployment

Estimated Reading Time: 6 Minutes

This article applies to Windows 64, Linux x86_64 and MacARM version of Datalogics Adobe PDF Library (APDFL) 21. Feature availability, component filenames, file sizes, and deployment requirements may differ on other platforms or in other APDFL versions.

 

Description

Optical character recognition (OCR) recognizes text in scanned documents and images. It can add searchable text to PDFs whose pages would otherwise contain only images.

OCR makes scanned content easier to search, select, copy, and extract. It is useful for digitizing paper records, organizing document collections, and making scanned information available for subsequent processing.

 

Samples

The installed samples are:
- CPlusPlus\Sample_Source\OCR\OCRPage\OCRPage.cpp: recognizes text on a PDF page.
- CPlusPlus\Sample_Source\OCR\OCRImage\OCRImage.cpp: recognizes text in an image and produces PDF output.

Public samples (github):
OCRPage
OCRImage

 

Files

Paths are relative to the SDK root. Sizes are uncompressed file lengths, rounded to two decimal places. Sizes and savings may vary by SDK build.

Windows
File or directory Size (MB)
CPlusPlus\Binaries\DL210OCREngine.ppi 5.99
CPlusPlus\Binaries\dltesseract5.dll 11.80
CPlusPlus\Binaries\tessdata4\ (entire directory) 860.04
Total 877.83

These components provide the OCR plug-in, recognition engine, and supporting recognition data. The tessdata4 directory total includes all supplied files and subdirectories.

Linux x86_64
File or directory Size (MB)
CPlusPlus/Binaries/DL210OCREngine.ppi.21.0.0.0 16.01
CPlusPlus/Binaries/libdltesseract5.so 17.65
CPlusPlus/Binaries/tessdata4/ (entire directory) 901.81

Symbolic links belonging to this component:

  • CPlusPlus/Binaries/DL210OCREngine.ppi → CPlusPlus/Binaries/DL210OCREngine.ppi.21.0.0
  • CPlusPlus/Binaries/DL210OCREngine.ppi.21.0.0 → CPlusPlus/Binaries/DL210OCREngine.ppi.21.0.0.0
MacARM
File or directory Size (MB) Role
CPlusPlus/Binaries/DL210OCREngine.ppi 6.38 Complete OCR plug-in bundle
CPlusPlus/Binaries/libdltesseract5.dylib 12.61 Tesseract recognition runtime; dynamic loading must be considered
CPlusPlus/Binaries/tessdata4 860.04 Complete installed language-model directory
CPlusPlus/Binaries/libicui18n.78.3.dylib 3.45 ICU internationalization library referenced by OCR and Tesseract
CPlusPlus/Include/Headers/OCREngineCalls.h 0.01 Development header; not required in an application runtime
CPlusPlus/Include/Headers/OCREngineExpT.h 0.01 Development header; not required in an application runtime
CPlusPlus/Include/Headers/OCREngineProcs.h 0.01 Development header; not required in an application runtime

CPlusPlus/Binaries/libicui18n.78.dylib points to libicui18n.78.3.dylib; CPlusPlus/Binaries/libicui18n.dylib points to libicui18n.78.dylib. Each link contributes 0.00 MB of regular-file payload under this measurement convention.

 

Omitting the Feature When Unused
Windows

If OCR is unused, omit DL210OCREngine.ppi, dltesseract5.dll, and the entire tessdata4 directory. The combined saving is 877.83 MB.

PDF processing does not require OCR simply because the input contains scanned pages. Without the OCR components, tested PDF opening, rendering, saving, reopening, text extraction, and library shutdown succeeded. Scanned pages remained image-only. Text previously added by OCR remained extractable without the OCR engine, with matching rendering and word counts.

The positive OCR test added 18 recognized words to the supplied OCRPage input. Tests also covered omission of the plug-in, engine DLL, and language-data directory individually and together.

Linux x86_64

When the application does not perform OCR, omit the following files and the complete data directory, saving 935.47 MB:

  • CPlusPlus/Binaries/DL210OCREngine.ppi
  • CPlusPlus/Binaries/DL210OCREngine.ppi.21.0.0
  • CPlusPlus/Binaries/DL210OCREngine.ppi.21.0.0.0
  • CPlusPlus/Binaries/libdltesseract5.so
  • CPlusPlus/Binaries/tessdata4/

With the listed exclusive components absent, APDFL initialization, PDF opening, text extraction, rendering, saving, reopening, and termination succeeded on the tested inputs. Word counts, rendered-image hashes, and document measurements matched the corresponding baseline. Scanned PDFs remained readable and renderable; without OCR, image-only pages did not acquire searchable text. Text previously added by OCR remained extractable without the OCR components.

Retain the APDFL ICU libraries and other core resources. The OCR savings do not include these shared libraries. Selecting a smaller language-data set is a different deployment choice and requires retaining the resources needed by the chosen languages.

MacARM

Native ARM64 tests established successful feature use before omission. With the components listed below absent, APDFL initialization, PDF opening, text extraction, rendering, saving, reopening, and termination succeeded for the tested documents. Extracted text and rendered pixels matched the corresponding baseline, including PDFs previously produced by the optional features.

Exact tested runtime omission list:

  • CPlusPlus/Binaries/DL210OCREngine.ppi (entire directory)
  • CPlusPlus/Binaries/libdltesseract5.dylib
  • CPlusPlus/Binaries/tessdata4` (entire directory)
  • CPlusPlus/Binaries/libicui18n.78.3.dylib
  • CPlusPlus/Binaries/libicui18n.78.dylib
  • CPlusPlus/Binaries/libicui18n.dylib

Runtime payload savings: 882.48 MB. Development headers and samples are not included in this figure.

Removing only Tesseract or `tessdata4` left the OCR function table available but caused recognition to fail with APDFL error `0x40000001`. Removing the OCR plug-in itself made its function table unavailable; the guarded test returned a controlled unavailable-feature result.

Retain `libicuuc.78.3.dylib`, `libicudata.78.3.dylib`, and their versioned and unversioned links: APDFL core itself links to them. The inspected native runtime dependency graph references `libicui18n.78.3.dylib` only from OCR and Tesseract, but any additional application dependency on ICU internationalization must also be retained. Keep the APDFL frameworks and the font, CMap, Unicode, and color-profile resources. Fonts remain necessary for embedding or rendering recognized text.

 

Application considerations
Windows

Remove unconditional OCR initialization and recognition calls when OCR is omitted. For optional installation, check gOCREngineHFT after InitOCREngineHFT before invoking OCR APIs. A non-null function table alone does not establish readiness: missing dltesseract5.dll or tessdata4 caused errors when OCR was requested. Handle initialization and recognition failures and guard cleanup.

If OCR remains enabled, language-data reduction requires separate validation for every supported language and recognition mode; selective trimming was not established by this investigation. Retain APDFL core dependencies and required font, CMap, Unicode, and color-profile resources. Validate the final product's retained workflows in an isolated deployment.

Linux x86_64

Check that the OCR HFT is available before calling OCR APIs, then check `OCREngineInitialize()` and handle APDFL exceptions. A present plug-in does not establish that the recognition engine or language data is usable: separate engine and data omission tests both caused OCR requests to fail while ordinary PDF processing succeeded.

Initialize and terminate OCR only when the feature is used; call `OCREngineTerminate()` after successful initialization and release OCR result objects and document resources. Removing files is insufficient if the application unconditionally invokes OCR.

MacARM

After successful APDFL initialization, assign `gOCREngineHFT = InitOCREngineHFT` and check for a null table before calling any `OCREngine*` or `PDOCR*` entry. Check `OCREngineInitialize()` separately. A present plug-in does not prove that Tesseract or the requested language models are usable. Check installed/configured languages and handle errors from engine creation and recognition. Release OCR parameters, engine instances, page references, and documents on every applicable exit path; terminate the initialized OCR plug-in before APDFL termination. The supplied OCRPage sample selects English, French, both Chinese variants, and Japanese, so deleting models without changing that configuration can break recognition.

Removing files alone is insufficient if application startup or a document workflow unconditionally calls the feature. Feature availability, feature initialization, and successful completion of a requested operation are separate checks.

 

How to Get Additional Help

Contact Datalogics Tech Support 

Fetch the answers quickly using our AI assistant Scout, available for any language. Scout also opens access to our MCP server, connecting APDFL with your favorite AI tools for faster and easier coding. 

OCR Components and Deployment
  • COMMENT