Integrate OCR capabilities into your iOS app
This guide provides step-by-step instructions for integrating the Nutrient iOS OCR library into your project.
Prerequisites
Ensure you have the following before integrating the Nutrient iOS OCR library:
-
Nutrient iOS SDK with OCR capabilities
-
PSPDFKit
andPSPDFKitOCR
are available as separate dynamic frameworks within the same download. -
Download the latest release from the Nutrient Portal, or start with a free trial.
-
Alternatively, use Swift Package Manager for seamless integration (refer to the integration section below).
-
-
Latest stable version of Xcode
-
The Nutrient iOS OCR library requires the latest stable version of Xcode available at the time of release.
-
Quick start with the Catalog example
To see OCR in action, run the OCRExample.swift
code sample in the Nutrient Catalog sample project:
-
Open
Catalog.xcodeproj
. -
Build and run the
Catalog
scheme. -
Search for OCR in the examples list and open the relevant example.
Integrating the Nutrient iOS OCR library
There are three ways to integrate the Nutrient iOS OCR library into your project:
-
Using Swift Package Manager
-
Using CocoaPods
-
Manual integration
Each of these approaches are outlined below.
Swift Package Manager (SwiftPM)
To add PSPDFKitOCR
to your project using SwiftPM, follow the steps below:
-
Integrate the Nutrient Swift package into your project.
-
Add
PSPDFKitOCR
using our public repository URL.

-
Manually add the required language files to your project.

CocoaPods
To integrate PSPDFKit
and PSPDFKitOCR
using CocoaPods, follow the steps below.
-
Add the following dependencies to your
Podfile
:
use_frameworks! target :YourTargetName do pod 'PSPDFKit', podspec: 'https://my.nutrient.io/pspdfkit-ios/latest.podspec' pod 'PSPDFKitOCR', podspec: 'https://my.nutrient.io/ocr/latest.podspec' end
-
Install the dependencies:
pod install
-
By default,
PSPDFKitOCR
includes trained data models for all supported languages. To reduce app size, include only the required languages by modifying yourPodfile
as shown below:
use_frameworks! target :YourTargetName do pod 'PSPDFKit', podspec: 'https://my.nutrient.io/pspdfkit-ios/latest.podspec' pod 'PSPDFKitOCR/PSPDFKitOCR', podspec: 'https://my.nutrient.io/ocr/latest.podspec' pod 'PSPDFKitOCR/English', podspec: 'https://my.nutrient.io/ocr/latest.podspec' pod 'PSPDFKitOCR/German', podspec: 'https://my.nutrient.io/ocr/latest.podspec' end
Manual integration
To integrate PSPDFKitOCR
manually:
-
Integrate Nutrient into your project.
-
Drag
PSPDFKitOCR.xcframework
into the Frameworks, Libraries, and Embedded Content section of your target. -
Add the necessary language files from
PSPDFKitOCR/Languages
to your project.

Next steps
To learn how to perform OCR on PDFs in iOS, refer to the performing OCR guide.