How to integrate OCR into a Java application

This guide outlines the additional dependencies required to enable optical character recognition (OCR) in Nutrient Java SDK and provides step-by-step instructions for integrating them into your project.

For details on OCR functionality, refer to the OCR overview guide.

Prerequisite: Additional package requirement

OCR support in Nutrient Java SDK is provided as a package separate from the core libraries-java package. To enable OCR functionality, you must include an additional package dependency as described below.

Integrating OCR using the Nutrient Maven repository

If you’re already using the Nutrient Maven repository for Nutrient Java SDK, integrating OCR only requires a dependency addition:

dependencies {
...
    implementation 'com.pspdfkit:libraries-java-ocr:1.6.1'
...
}

Add the dependency above to your build.gradle file to enable OCR functionality.

Manual integration

If you’re unable to use the Nutrient Maven repository, you can manually download the required packages from the Nutrient Portal and integrate them into your project. Follow the manual integration guide for detailed instructions.

By following the steps above, you can integrate OCR capabilities into your Java application, enabling advanced text recognition and document processing features.

Next steps

To learn how to perform OCR on PDFs in Java, refer to the guide on how to perform OCR.