react-native-pdf Installation and Native PDF Viewing
A <Pdf /> component for react-native
At a glance
- What is it?
- react-native-pdf gives React Native applications a native PDF viewer for iOS, Android, and documented Windows setup. Its main adoption cost is native integration: the package requires react-native-blob-util, platform configuration, and a custom development build when Expo is involved.
- Who is it for?
- Adopt react-native-pdf when a React Native application needs an interactive native PDF view and the team can maintain platform-specific native setup. Do not choose it for Expo Go or pure web applications.
- Can I use it commercially?
- Yes. MIT is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
- Is it still maintained?
- Yes. The repository last received commits 64 days ago.
- What is it written in?
- Mainly JavaScript, according to GitHub's language statistics.
Answers come from the project's GitHub data, last synced on October 22, 2026, and from our analysis. They are not legal advice.
Editorial analysis
Where react-native-pdf Fits in a React Native Application
react-native-pdf addresses a specific gap in React Native applications: presenting PDF documents through a native view rather than treating the file as an ordinary web resource. According to the README, the component can read a PDF from a URL, blob, local file, or bundled asset. It also supports horizontal and vertical display, dragging, zooming, double-tap zoom, password-protected files, and navigation to a specific page. These are viewer requirements rather than a complete document management system.
The intended users are developers building iOS or Android applications in React Native. The repository also contains a `windows/` directory and detailed Windows setup instructions, although the package description specifically calls out iOS and Android. It is a better fit for an application that displays documents to a person on a device than for server-side PDF conversion, text extraction, form processing, or batch document generation. The README does not claim those capabilities.
Native integration is a defining constraint. `react-native-pdf` uses `react-native-blob-util` for filesystem access, and that dependency must be installed with it. Expo Go cannot load the package because it relies on native modules. An Expo project would need a custom development client and the out-of-tree Expo config plugin. This makes the component a poor match for teams that require a quick Expo Go prototype without native build work.
The JavaScript and Native Viewer Path
The repository layout shows a JavaScript API layer backed by platform implementations under `android/`, `ios/`, and `windows/`. The package entry point is `index.js`, with TypeScript declarations in `index.d.ts` and Flow declarations in `index.js.flow`. View-related JavaScript files include `PdfView.js`, `PdfViewFlatList.js`, `PdfPageView.js`, `DoubleTapView.js`, and `PinchZoomView.js`. Based on those filenames, the JavaScript side separates the document view, page rendering, list-based rendering, double-tap handling, and pinch zoom.
`PdfManager.js` is the corresponding manager file, while `fabric/` contains the Fabric component source configured in `package.json`. The package also ships `react-native-pdf.podspec` for CocoaPods integration on Apple platforms. The v7.0.5 release notes state that the Android implementation avoids loading the legacy `PdfView` on the Fabric path. That is direct evidence that the project distinguishes legacy native rendering from the newer Fabric component architecture.
The exact source-loading sequence is not documented in the README, so it would be unsafe to claim how a URL is transferred into a temporary file or when caching occurs. The README does establish that `react-native-blob-util` handles filesystem access and that source types include URLs, blobs, local files, and assets. It also says downloaded files can be cached. The release notes for v7.0.5 add that download status is exposed and mention awaiting a temporary-file unlink and copy, but they do not provide a complete public API for those operations.
Installing react-native-pdf with Its Required Peer Package
The documented npm installation adds both the viewer and its required filesystem peer dependency. The project explicitly warns that installing only `react-native-pdf` is insufficient because filesystem access is delegated to `react-native-blob-util`.
npm install react-native-pdf react-native-blob-util --saveAfter this command, the application should have both packages recorded as dependencies. The repository's package metadata requires `react-native-blob-util` at `>=0.13.7`, while the compatibility table associates `react-native-pdf` 6.4.0 or later with that blob utility version for newer React Native releases. The table covers older React Native lines as well, so selecting a release requires matching the application's React Native generation rather than installing solely by package name.
For projects using Yarn, the README provides the corresponding command:
yarn add react-native-pdf react-native-blob-utilNeither command completes every platform setup step. Native linking or configuration follows, and the compatibility branch depends on the React Native version in the consuming application.
iOS Setup and the First Viewer Integration
For React Native 0.60 and above, the README says to run CocoaPods from the application's `ios` directory. Automatic linking is not required for React Native 0.60 and above.
cd ios
pod installThis should update the generated CocoaPods integration used by the iOS build. For React Native 0.59 and below, the documented commands link both native packages:
react-native link react-native-blob-util
react-native link react-native-pdfThe first real component integration cannot be reproduced from the README because it does not include a `<Pdf />` JavaScript example or document its import and props. The repository does contain `example/PDFExample.js`, which is the appropriate project-specific starting point, and `example/test.pdf` supplies a bundled document for the example application. That omission matters. The feature list names supported capabilities, but it does not confirm the current import path, prop names, callback signatures, password field syntax, or page-navigation syntax. Inventing those details would make a setup tutorial fail even if dependency installation succeeds.
The documented build troubleshooting path is limited but concrete. From the example project directory, the README recommends installing dependencies, entering `ios`, running `pod install`, returning to the project root, and launching the iOS application:
yarn install
cd ios
pod install
cd ..
react-native run-iosThese commands address missing dependencies or pods. They do not resolve an invalid PDF URI, unsupported source type, or an iOS transport-security restriction.
Android Packaging Rules and Network Failure Modes
Android projects using React Native 0.59.0 and above must add packaging rules to `android/app/build.gradle`. The README identifies duplicate native libraries as the reason for selecting the first matching occurrence. The required additions are an Android `packagingOptions` block containing `pickFirst` entries for several `libc++_shared.so` and `libjsc.so` paths. This is build configuration, not JavaScript application logic.
For React Native 0.59.0 and below, the documented integration path uses the two legacy link commands shown earlier. For newer versions, autolinking handles the package, but the Android packaging configuration still needs to be added according to the README.
A PDF source served over plain HTTP can produce a white or gray screen or a loading indicator that does not advance. The README attributes this possibility to transport restrictions and directs iOS developers to add an exception in `info.plist`. It also points Android developers to documentation about cleartext HTTP traffic. This is a meaningful failure mode for development environments that still use an HTTP endpoint. A viewer component cannot display a resource that the operating system refuses the application from fetching.
The README also identifies native linking as a possible cause when the PDF is not visible. Its suggested troubleshooting references specific repository issues, but it does not define a command for inspecting the native view. The first checks are therefore the native build configuration and the validity of the `uri`, rather than JavaScript-only debugging.
Version 7 Changes, Maintenance Signals, and Upgrade Cost
The repository is not archived, and its last push was on 2026-08-20. Version 7.0.5 was released on 2026-08-13, following v7.0.3 on 2026-03-18 and v7.0.0 on 2025-10-08. These dates show recent release activity, but they do not remove the cost of upgrading a native dependency.
The v7.0.5 changes cross several layers. According to the release notes, the release upgraded `shell-quote` to 1.8.4 for CVE-2026-9277, restored Android zoom and scroll offsets when the view is reattached, allowed iOS PDFKit text selection to begin after a long press, exposed download HTTP status, and fixed a temporary-file copy race. It also avoided loading the legacy Android view on Fabric and corrected Flow type and stylesheet imports. These are targeted changes, but they illustrate why a React Native viewer upgrade requires native build verification as well as JavaScript checks.
The project is distributed under the MIT license. That permits use and modification under the license's terms, but this review does not interpret the license or provide legal advice. Applications should also account for the separate package, platform toolchain, and compatibility requirements of `react-native-blob-util`. The documentation does not describe a formal upgrade process or migration guide for v7, so adopters must review release notes and test their actual source and orientation cases.
When react-native-pdf Is the Wrong Native Viewer Choice
The clearest wrong-environment case is Expo Go. The README states that the package is unavailable in Expo Go because it is a native module. Teams that want to use Expo should evaluate a custom development client and the out-of-tree Expo config plugin. Merely installing the npm packages does not turn an Expo Go application into a compatible host.
react-native-pdf is also the wrong tool when the requirement is a browser-only PDF experience. The repository documents native mobile and Windows setup rather than a web viewer. Likewise, teams seeking document conversion, OCR, indexing, form filling, or server-side rendering should not treat this viewer component as a processing library. Its documented scope is display and interaction within a React Native application.
There is a compatibility boundary for older React Native projects. The table maps older React Native generations to older `react-native-pdf` releases, while the package metadata requires `react-native-blob-util` `>=0.13.7`. A team pinned to an older native stack may need to remain on an older viewer line or validate the newer line against its build toolchain. The README does not supply a universal migration recipe.
An alternative approach for applications that do not require this package's interactive native capabilities is to open the PDF outside the React Native component tree. The practical difference is control: an external viewer delegates document presentation to another application, while `<Pdf />` is intended to keep rendering, scrolling, zoom, page access, and password handling inside the app's React Native surface. The README does not document an external-opening API for this package, so that alternative requires a separate application or platform mechanism.
Editorial conclusion
Adopt react-native-pdf when a React Native application needs an interactive native PDF view and the team can maintain platform-specific native setup. Do not choose it for Expo Go or pure web applications. Verify the React Native and react-native-blob-util version combination first, then confirm the target platform can load the PDF source over its required network and filesystem path.
Frequently asked questions
Which extra package does react-native-pdf require?
Install `react-native-blob-util` alongside `react-native-pdf`. The project uses it for filesystem access, and the package metadata requires version `>=0.13.7`.
Can react-native-pdf display a PDF in Expo Go?
No. The README says the package is unavailable in Expo Go because it requires a native module. Expo projects need a custom development client and the documented out-of-tree Expo config plugin.
Where can I find a working react-native-pdf integration example?
The repository contains `example/PDFExample.js` and a bundled `example/test.pdf`. The README does not include the component's current import or prop syntax, so those files are the relevant starting points.
Official sources
Add this badge to your README
If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.
[](https://hysenlabs.com/projects/wonday-react-native-pdf)Was this useful?