5.0.0 is not a drop-in upgrade. Install it only if the app already uses the React Native New Architecture and you need the Nitro JSI document API (getPdfLibrary().open(path)).
Production apps on 4.x stay on the published line:
npm install react-native-pdf-jsi@4.5.0npm install react-native-pdf-jsi with no version follows the npm latest tag. If that tag is 5.0.0, the next native build fails for the old architecture, Windows, pdfId strings, and the native modules removed below.
- Old Architecture (Paper). There is no fallback.
- Windows.
pdfIdstring APIs. Open a document withgetPdfLibrary().open(path)instead.- Native modules:
PDFJSIManager,PDFExporter,PDFTextModule,FileManager,FileDownloader. createSearchablePDFandregisterPathForSearch.
5.0 requires react-native-nitro-modules. Details are in MIGRATION-5.0.md.
PDF viewer for React Native. Version 5 is the Nitro JSI path on the New Architecture.
- Nitro owns document logic: open, page geometry, render, search, text, OCR, merge, split, compress, and the on-disk cache.
- Fabric owns the view (
RNPDFPdfView) and nothing else. - iOS is a Swift Nitro hybrid on PDFKit and Vision.
- Android is a C++ Nitro hybrid on PDFium.
- Windows is not supported.
Install this version only when you need that JSI logic. Everyone else keeps react-native-pdf-jsi@4.5.0.
npm install react-native-pdf-jsi@5.0.0 react-native-nitro-modules react-native-blob-util
cd ios && pod installThe host app must build with the New Architecture enabled. There is no Paper fallback.
Optional Android OCR (ML Kit) is off unless you set pdfJsiEnableOcr=true in gradle.properties. iOS OCR uses Vision and needs no extra flag.
import Pdf from 'react-native-pdf-jsi';
<Pdf
source={{ uri: filePath }}
onLoadComplete={(pages) => {}}
onPageChanged={(page, total) => {}}
/>Cheap reads are synchronous. Work that touches the file or rasterizes a page returns a Promise.
import { getPdfLibrary, openPdf } from 'react-native-pdf-jsi/src/PDFJSI';
const library = getPdfLibrary();
const document = await library.open(filePath);
document.pageCount; // number, sync
document.pageSize(0); // { width, height }, sync, 0-based
await document.renderPage(0, 2);
await document.searchText('hello', 0, document.pageCount - 1);
await document.extractText(0);
document.close();Library calls that do not belong to one open document:
await library.mergePDFs([a, b], outputPath);
await library.splitPDF(filePath, JSON.stringify([[0, 1]]), outputDir);
await library.extractPages(filePath, JSON.stringify([0, 2]), outputPath);
await library.compressPDF(inputPath, outputPath, 6);
library.jsiStats; // sync
library.kb16Support; // sync
library.ocrAvailable; // syncPage indexes on the Nitro handle are 0-based. The older JS helpers renderPageDirect and searchTextDirect still accept 1-based page numbers and convert them.
Saving into the public Downloads folder is done in JavaScript with react-native-blob-util (FileManager.downloadToPublicFolder). There is no native file-picker module.
react-native-pdf-jsi has crossed 223K downloads. Thank you to everyone who has used the library and supported its development.
I've recently worked on a complete migration to Nitro Modules and am exploring a paid offering for developers and teams interested in this implementation.
- Access to the Nitro-based implementation under a commercial license, where applicable.
- Assistance with setup and integration.
- Help troubleshooting native Android and iOS build issues.
- Direct support from the maintainer.
The Nitro Edition and dedicated support will be available as a paid offering. Pricing and licensing details can be discussed based on your requirements.
Contact: punithm865@gmail.com
Your support helps me maintain the library and continue building for the React Native community.