Skip to Content
NexPDF

Installation

Add the NexPDF React Native package to your app, with the NexPDF Android SDK on Android and the NexPdf and NexPdfUI pods on iOS.

English

Install the package

The source of the package is the public repository nexdevit/nexpdf-react-native:

git clone https://github.com/nexdevit/nexpdf-react-native
npm install ./nexpdf-react-native

Android: add the NexPDF Android SDK

The module is autolinked. It depends on the NexPDF Android SDK, either as the com.nexdevit:nexpdf-android:1.1.0 AAR or as a :nexpdf-android project in your settings.gradle.

Download nexpdf-android-1.1.0-maven.zip from the v1.1.0 release and unzip it into your local Maven repository, which the module reads:

unzip nexpdf-android-1.1.0-maven.zip -d ~/.m2/repository

The module compiles with Java 17 and needs minSdk 24 or later.

iOS: add the NexPdf and NexPdfUI pods

The core and the reader UI come from the NexPDF Swift SDK. Clone nexdevit/nexpdf-swift, download NexPdfCore.xcframework.zip from the same release and unzip it into that folder:

git clone https://github.com/nexdevit/nexpdf-swift
unzip NexPdfCore.xcframework.zip -d nexpdf-swift

Add both pods to ios/Podfile, with the path of that folder:

ios/Podfile
pod 'NexPdf',   :path => '../nexpdf-swift'
pod 'NexPdfUI', :path => '../nexpdf-swift'

Then install the pods. The deployment target must be iOS 15.0 or later.

cd ios && pod install

Rebuild the app

The package has native code, so rebuild the app instead of reloading JavaScript:

npx react-native run-android

Check it from JavaScript:

import { NexPdf } from '@nexdevit/nexpdf-react-native';

console.log(await NexPdf.version());

A NexPdfError saying "NexPDF native module not linked" means the app was not rebuilt after the package was installed.

On this page